diff --git a/config/nrfconnect/app/enable-gnu-std.cmake b/config/nrfconnect/app/enable-gnu-std.cmake index 5f31e1a5c62ab8..4019bbd31bf27a 100644 --- a/config/nrfconnect/app/enable-gnu-std.cmake +++ b/config/nrfconnect/app/enable-gnu-std.cmake @@ -1,6 +1,5 @@ add_library(gnu17 INTERFACE) target_compile_options(gnu17 INTERFACE - $<$:-std=gnu++17> - -D_SYS__PTHREADTYPES_H_) + $<$:-std=gnu++17>) target_link_libraries(app PRIVATE gnu17) diff --git a/config/nrfconnect/chip-module/Kconfig b/config/nrfconnect/chip-module/Kconfig index 5d03e82530c84e..e3c5a86bf96c1d 100644 --- a/config/nrfconnect/chip-module/Kconfig +++ b/config/nrfconnect/chip-module/Kconfig @@ -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 diff --git a/config/nrfconnect/chip-module/Kconfig.defaults b/config/nrfconnect/chip-module/Kconfig.defaults index 562755b14b9c25..7e3c2a6077d5ce 100644 --- a/config/nrfconnect/chip-module/Kconfig.defaults +++ b/config/nrfconnect/chip-module/Kconfig.defaults @@ -24,6 +24,10 @@ if CHIP # System configuration # ============================================================================== +choice LIBC_IMPLEMENTATION + default NEWLIB_LIBC +endchoice + config ASSERT default y @@ -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 @@ -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 @@ -487,4 +491,4 @@ config OPENTHREAD_SHELL endif # SHELL -endif \ No newline at end of file +endif # CHIP diff --git a/config/nrfconnect/chip-module/Kconfig.features b/config/nrfconnect/chip-module/Kconfig.features index 369f992c9a5070..e6a4e52d500e13 100644 --- a/config/nrfconnect/chip-module/Kconfig.features +++ b/config/nrfconnect/chip-module/Kconfig.features @@ -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 diff --git a/config/nrfconnect/chip-module/Kconfig.mcuboot.defaults b/config/nrfconnect/chip-module/Kconfig.mcuboot.defaults index 31759beba22ffc..224dc57bfc2769 100644 --- a/config/nrfconnect/chip-module/Kconfig.mcuboot.defaults +++ b/config/nrfconnect/chip-module/Kconfig.mcuboot.defaults @@ -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 @@ -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 @@ -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 diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig index bdfa709592adff..c806ceed805385 100644 --- a/config/zephyr/Kconfig +++ b/config/zephyr/Kconfig @@ -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 @@ -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. @@ -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 diff --git a/src/platform/Zephyr/ConfigurationManagerImpl.cpp b/src/platform/Zephyr/ConfigurationManagerImpl.cpp index f41eed0492080f..2e937c95f0f9e0 100644 --- a/src/platform/Zephyr/ConfigurationManagerImpl.cpp +++ b/src/platform/Zephyr/ConfigurationManagerImpl.cpp @@ -40,6 +40,10 @@ #include #endif +#ifdef CONFIG_NET_L2_OPENTHREAD +#include +#endif + namespace chip { namespace DeviceLayer { @@ -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); diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h index f9e445f35fb3d4..2e3c93289f8516 100644 --- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h +++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h @@ -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 diff --git a/src/platform/nrfconnect/SystemPlatformConfig.h b/src/platform/nrfconnect/SystemPlatformConfig.h index 60d9c354d01ab1..fb544466dcdd75 100644 --- a/src/platform/nrfconnect/SystemPlatformConfig.h +++ b/src/platform/nrfconnect/SystemPlatformConfig.h @@ -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