Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nrfconnect] Introduced several platform configuration fixes #33194

Merged
merged 9 commits into from
Apr 26, 2024
3 changes: 1 addition & 2 deletions config/nrfconnect/app/enable-gnu-std.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
add_library(gnu17 INTERFACE)
target_compile_options(gnu17
INTERFACE
$<$<COMPILE_LANGUAGE:CXX>:-std=gnu++17>
-D_SYS__PTHREADTYPES_H_)
$<$<COMPILE_LANGUAGE:CXX>:-std=gnu++17>)
target_link_libraries(app PRIVATE gnu17)
5 changes: 5 additions & 0 deletions config/nrfconnect/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,9 @@ config CHIP_FACTORY_RESET_ON_KEY_MIGRATION_FAILURE
Perform factory reset of the device if the operational key for Fabric has not been migrated
properly to PSA ITS storage.

config CHIP_PERSISTENT_SUBSCRIPTIONS
default n
# selecting experimental for this feature since there is an issue with multiple controllers.
select EXPERIMENTAL

endif # CHIP
12 changes: 8 additions & 4 deletions config/nrfconnect/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ if CHIP
# System configuration
# ==============================================================================

choice LIBC_IMPLEMENTATION
default NEWLIB_LIBC
endchoice

config ASSERT
default y

Expand Down Expand Up @@ -318,13 +322,13 @@ if PSA_CRYPTO_DRIVER_CC3XX && PSA_CRYPTO_DRIVER_OBERON
config PSA_USE_CC3XX_HASH_DRIVER
default n

endif
endif # PSA_CRYPTO_DRIVER_CC3XX && PSA_CRYPTO_DRIVER_OBERON

# Spake2+ support
config MBEDTLS_MD_C
default y

endif
endif # CHIP_CRYPTO_PSA

if !CHIP_CRYPTO_PSA

Expand Down Expand Up @@ -367,7 +371,7 @@ config MBEDTLS_ECP_C
config MBEDTLS_ECP_DP_SECP256R1_ENABLED
default y

endif
endif # !CHIP_CRYPTO_PSA

config MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
default n if CHIP_WIFI
Expand Down Expand Up @@ -487,4 +491,4 @@ config OPENTHREAD_SHELL

endif # SHELL

endif
endif # CHIP
4 changes: 1 addition & 3 deletions config/nrfconnect/chip-module/Kconfig.features
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,13 @@ config CHIP_WIFI

config CHIP_QSPI_NOR
bool "Enable QSPI NOR feature set"
imply NORDIC_QSPI_NOR
help
Enables QSPI NOR flash with a set of options for configuring pages and
buffer sizes.

if CHIP_QSPI_NOR

config NORDIC_QSPI_NOR
default y

config NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE
default 16

Expand Down
17 changes: 1 addition & 16 deletions config/nrfconnect/chip-module/Kconfig.mcuboot.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,7 @@
config MAIN_STACK_SIZE
default 10240

config BOOT_SWAP_SAVE_ENCTLV
default n

config BOOT_ENCRYPT_RSA
default n

config BOOT_ENCRYPT_EC256
default n

config BOOT_ENCRYPT_X25519
config BOOT_ENCRYPT_IMAGE
default n

config BOOT_BOOTSTRAP
Expand All @@ -53,9 +44,6 @@ if BOARD_NRF7002DK_NRF5340_CPUAPP
config SPI
default y

config SPI_NOR
default y

choice SPI_NOR_SFDP
default SPI_NOR_SFDP_DEVICETREE
endchoice
Expand All @@ -74,9 +62,6 @@ endif
# All boards beside nRF7002DK use QSPI NOR external flash
if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF52840DK_NRF52840

config NORDIC_QSPI_NOR
default y

config NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE
default 4096

Expand Down
7 changes: 5 additions & 2 deletions config/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ config CHIP_PROJECT_CONFIG

config CHIP_ENABLE_DNSSD_SRP
bool "OpenThread Service Registration Protocol"
default y if NET_L2_OPENTHREAD
default y
depends on NET_L2_OPENTHREAD
imply OPENTHREAD_ECDSA
imply OPENTHREAD_SRP_CLIENT
help
Expand All @@ -318,7 +319,8 @@ config CHIP_ENABLE_DNSSD_SRP

config CHIP_ENABLE_DNS_CLIENT
bool "OpenThread DNS client"
default y if NET_L2_OPENTHREAD
default y
depends on NET_L2_OPENTHREAD
imply OPENTHREAD_DNS_CLIENT
help
Enables using the OpenThread DNS client for the Matter service discovery.
Expand Down Expand Up @@ -413,6 +415,7 @@ config CHIP_THREAD_SSED

config CHIP_OPENTHREAD_CONFIG
string "Custom OpenThread configuration file"
depends on NET_L2_OPENTHREAD
help
Provides a path to an OpenThread configuration file. The path can be
either absolute or relative to the application directory. When this option
Expand Down
9 changes: 9 additions & 0 deletions src/platform/Zephyr/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
#include <zephyr/settings/settings.h>
#endif

#ifdef CONFIG_NET_L2_OPENTHREAD
#include <platform/ThreadStackManager.h>
#endif

namespace chip {
namespace DeviceLayer {

Expand Down Expand Up @@ -179,6 +183,11 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg)
{
ChipLogProgress(DeviceLayer, "Performing factory reset");

// Lock the Thread stack to avoid unwanted interaction with settings NVS during factory reset.
#ifdef CONFIG_NET_L2_OPENTHREAD
ThreadStackMgr().LockThreadStack();
#endif

#ifdef CONFIG_CHIP_FACTORY_RESET_ERASE_NVS
void * storage = nullptr;
int status = settings_storage_get(&storage);
Expand Down
4 changes: 4 additions & 0 deletions src/platform/nrfconnect/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@
#endif // CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY

#ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE
#if defined(CONFIG_LTO)
#define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE 10240
#else
#define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE 6144
#endif // CONFIG_LTO
#endif // CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE

#define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE 64
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nrfconnect/SystemPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct ChipDeviceEvent;
#define CHIP_SYSTEM_CONFIG_USE_SOCKETS 1

#ifndef CONFIG_ARCH_POSIX
#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 8
#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 15
#endif

#ifndef CHIP_SYSTEM_CONFIG_PACKETBUFFER_CAPACITY_MAX
Expand Down
Loading