Skip to content

Commit 4c7f38d

Browse files
kkasperczyk-noDamian-Nordicrestyled-commits
authored
[nrfconnect] Update nRF Connect SDK version to 2.4.0 (#27010)
* [nrfconnect] Updated nRF Connect SDK to 2.4.0 Bumped recommended nRF Connect SDK version to 2.4.0 and included several bug fixes and improvements: 1. Extend the connection request log with RSSI. This comes in handy especially during tests related to TX/RX power. Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> 2. Support disabling Wi-Fi LPM during the OTA DFU. Added subclass of OTAImageProcessorImpl whcih implements Wi-Fi specific optimization for LPM which should be disabled during OTA due to the high throughput requirements. This allows applications to use the OTAImageProcessorImplWiFi to do the job. Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> 3. Provide configs for Matter NUS feature Matter NUS feature allows to add of BLE Nordic UART Service and register commands which allow controlling the Matter device via BLE. This can be useful when the device loses connection with a Matter Controller but it should be controlled in another way for e.g. a Door Lock. 4. FactoryDataProvider: align the fprotect memory block Due to the smallest atomic SPU block (16k for nRF53) which can be protected we need to calculate proper offsets to include factory data partition. Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> 5. nrfconnect: migrate to new MCUmgr Kconfig options Migrate to new MCUmgr Kconfig options using: $ZEPHYR_BASE/scripts/utils/migrate_mcumgr_kconfigs.py Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no> 6. Added IMAGE_ACCESS_HOOKS config to nRF53 config set CONFIG_IMAGE_ACCESS_HOOKS is required for nRF53 to confirm image during DFU over BLE after the changes provided by the recent Zephyr's upmerge. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no> 7. Changed WPA SUPP logs level to error * Changed default log level to error * Changed WPA supplicant log levet to error. This is a workaround and it will be removed once default log levels fix to Zephyr will be merged. Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no> 8. Fixed dependencies for CHIP_DFU_OVER_BT_SMP kconfig Some Kconfigs selected by the CHIP_DFU_OVER_BT_SMP have unmet dependencies. Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no> 9. Set BLE connection to 1 for NUS We decided to work with single BLE connection when NUS is active. 10. Repair a path within error messages in FD ptyhon script Two paths were set wrongly in the factory data python script. 11. Fixed system workqueue stack overflow for Wi-Fi After failing to connect to the Wi-Fi network (e.g. due to bad password) the application falls into stack overflow. Increased the stack size to handle the connection failure properly. Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no> 12. Disable bonding for NUS Matter NUS should require providing a PIN code before each pairing, so we do not want to store anything in persistent storage and we should disable the Bluetooth LE bonding feature. 13. Disable unnecessary assert information Limit assert information for Matter applications to file name and file number. Signed-off-by: Lukasz Duda <lukasz.duda@nordicsemi.no> 14. Introduce workaround to Wi-Fi connection recovery It was observed that sometimes WPA supplicant may stuck in the reconnection process. This change introduces a workaround and fixes for existing recovery mechanism: * Changed is-Recovery-Aborted approach to is-Recovery-started. * Distinguished disconnects requested by the application from the disconnects coming from the supplicant. * Added scheduling recovery procedure if supplicant was not able to re-connect to the network for given amount of time (60 s). Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no> 15. Adapt WiFiManager to the new wifi_ps_config API The wifi_ps_config has been extended in Zephyr so this patch is need to avoid build errors. Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> 16. Integrated new Wi-Fi disconnect completed event Integrated handling new Wi-Fi disconnect completed event, what should fix occassional failures observed during connection recovery. Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no> 17. Fixed nRF7002 EK shield kconfig name Due to introduction of new nRF7002 shields, the nRF7002 EK shield kconfig name was changed and we have to align our configuration. Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no> 18. [nrfconnect] Use default number of RTC channels The default number of RTC channels on nRF5340 was increased from 2 to 3 some time ago, but Matter applications are still built with 2 user channels. This causes that CSL transmitter does not work properly on Matter Thread Router devices. 19 Add a workaround to WiFi recovery During the recovery procedure, if the net_mgmt function returns the value "-16" the device cannot recover the WiFi network until the reboot is called. This workaround allows the device to try to rescan the WiFi network even if the net_mgmt function returned an error. This workaround works only, when the WiFi recovery mechanism is active. 20. moved bt_fixed_passkey config to the features set BT_FIXED_PASSKEY cannot be added to prj_release.conf file because it causes a CMAKE warning. The config has been moved to the Kconfig.feature file. Fix the build warning in door-lock-server This fixes the uninitialized variable warning appearing when compiling the door lock app. Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> 21. Fixed nrf7002 kconfig name again nRF7002 EK kconfig name changed once again, so we need to align our kconfigs to that. Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no> * [zephyr] Remove device argument from SYS_INIT() callbacks. The SYS_INIT() callback API changed in Zephyr and Matter code alignments were needed. * [nrfconnect] Stop using Zephyr POSIX layer After recent changes in Zephyr, the Zephyr POSIX layer no longer includes missing POSIX definitions from the standard library. Given that and that the Zephyr POSIX layer is very incomplete, it is no longer possible to build Matter samples using that layer. Disable Zephyr socket layer, and use NET_SOCKETS_POSIX_NAMES which only wraps the socket functions with POSIX names. Make sure that proper headers are included when using this configuration. * [nrfconnect] Removed obsolete MCUMGR SMP BT config Replaced CONFIG_MCUMGR_SMP_BT that is no longer supported with the CONFIG_MCUMGR_TRANSPORT_BT * Addressed review comments * Added CHIP_NRF_PLATFORM symbol to conditionally modify generic Zephyr configuration * Updated docker versions for cloud builds * Updated sdk-zephyr toolchain version to 0.16.0 in build scripts for nrf platform. * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Fixed chef CI workflow * Fixed compilation errors * Fixed typo in wake event * Removed ifdef leading to compilation errors for Darwin and Linux and added ifdef for usleep usage that is a root cause of problems on Zephyr. * Fix more compilation errors * [chef] fixes to Zephyr environment variables 1. Use Zephyr SDK toolchain. 2. Use proper shell configuration. --------- Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no> Co-authored-by: Damian Krolik <damian.krolik@nordicsemi.no> Co-authored-by: Restyled.io <commits@restyled.io>
1 parent a73c8e9 commit 4c7f38d

File tree

64 files changed

+582
-162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+582
-162
lines changed

.github/workflows/chef.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
if: github.actor != 'restyled-io[bot]'
3636

3737
container:
38-
image: connectedhomeip/chip-build:0.7.3
38+
image: connectedhomeip/chip-build:0.7.16
3939
options: --user root
4040

4141
steps:
@@ -71,7 +71,7 @@ jobs:
7171
if: github.actor != 'restyled-io[bot]'
7272

7373
container:
74-
image: connectedhomeip/chip-build-esp32:0.7.3
74+
image: connectedhomeip/chip-build-esp32:0.7.16
7575
options: --user root
7676

7777
steps:
@@ -107,7 +107,7 @@ jobs:
107107
if: github.actor != 'restyled-io[bot]'
108108

109109
container:
110-
image: connectedhomeip/chip-build-nrf-platform:0.7.3
110+
image: connectedhomeip/chip-build-nrf-platform:0.7.16
111111
options: --user root
112112

113113
steps:

.github/workflows/examples-nrfconnect.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
if: github.actor != 'restyled-io[bot]'
4141

4242
container:
43-
image: connectedhomeip/chip-build-nrf-platform:0.7.3
43+
image: connectedhomeip/chip-build-nrf-platform:0.7.16
4444
volumes:
4545
- "/tmp/bloat_reports:/tmp/bloat_reports"
4646

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.3.0
1+
v2.4.0

config/nrfconnect/chip-module/CMakeLists.txt

+7-8
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,16 @@ include(${COMMON_CMAKE_SOURCE_DIR}/chip_gn_args.cmake)
5050
include(${COMMON_CMAKE_SOURCE_DIR}/chip_gn.cmake)
5151

5252
# Prepare compiler flags
53-
matter_add_flags(-D_DEFAULT_SOURCE)
54-
5553
if (CHIP_CFLAGS)
5654
matter_add_flags("${CHIP_CFLAGS}")
5755
endif()
5856

57+
matter_add_flags(-D_POSIX_C_SOURCE=200809)
58+
5959
if (CONFIG_ARM)
6060
matter_add_cflags(--specs=nosys.specs)
6161
endif()
6262

63-
if (CONFIG_POSIX_API)
64-
matter_add_flags(-D_SYS__PTHREADTYPES_H_)
65-
matter_add_flags(-isystem${ZEPHYR_BASE}/include/zephyr/posix)
66-
endif()
67-
6863
if (CONFIG_NORDIC_SECURITY_BACKEND)
6964
zephyr_include_directories($<TARGET_PROPERTY:mbedtls_external,INTERFACE_INCLUDE_DIRECTORIES>)
7065
zephyr_include_directories($<TARGET_PROPERTY:mbedcrypto_common,INTERFACE_INCLUDE_DIRECTORIES>)
@@ -197,8 +192,12 @@ matter_build(chip
197192
DEVICE_INFO_EXAMPLE_PROVIDER ${CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER}
198193
GN_DEPENDENCIES kernel
199194
)
195+
200196
set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS chip)
201-
target_compile_definitions(chip INTERFACE _DEFAULT_SOURCE)
197+
# Enable visibility of POSIX.1-2008 functions, such as strnlen
198+
target_compile_definitions(chip INTERFACE _POSIX_C_SOURCE=200809)
199+
# Make sure that kernel symbols that are only referenced by the Matter libraries are resolved.
200+
target_link_libraries(chip INTERFACE $<TARGET_FILE:kernel>)
202201

203202
if (CONFIG_CHIP_MALLOC_SYS_HEAP_OVERRIDE)
204203
target_link_options(chip INTERFACE

config/nrfconnect/chip-module/Kconfig

+23-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ rsource "../../zephyr/Kconfig"
1818

1919
if CHIP
2020

21+
config CHIP_NRF_PLATFORM
22+
bool
23+
default y
24+
help
25+
States that the configuration uses Matter nRF platform,
26+
what can be used to conditionally deviate from Zephyr generic configuration
27+
for nRF platform related purposes.
28+
2129
# See config/zephyr/Kconfig for full definition
2230
config CHIP_DEVICE_VENDOR_NAME
2331
default "Nordic Semiconductor ASA"
@@ -94,7 +102,7 @@ config CHIP_MALLOC_SYS_HEAP
94102
config CHIP_FACTORY_DATA
95103
bool "Factory data provider"
96104
select ZCBOR
97-
select FPROTECT
105+
imply FPROTECT
98106
help
99107
Enables the default nRF Connect factory data provider implementation that
100108
supports reading the factory data encoded in the CBOR format from the
@@ -134,6 +142,20 @@ config CHIP_FACTORY_DATA_ROTATING_DEVICE_UID_MAX_LEN
134142
help
135143
Maximum acceptable length of rotating device ID unique ID in bytes.
136144

145+
config CHIP_FACTORY_DATA_WRITE_PROTECT
146+
bool "Enable Factory Data write protection"
147+
select FPROTECT
148+
depends on CHIP_FACTORY_DATA
149+
default y if CHIP_FACTORY_DATA
150+
help
151+
Enables the write protection of the Factory Data partition in the flash memory.
152+
This is a recommended feature, but it requires the Settings partition size to be
153+
a multiple of FPROTECT_BLOCK_SIZE and the Factory Data partition to be placed
154+
right after the application partition in the address space (the Factory Data
155+
partition offset must be equal to the last address of the application partition).
156+
The second requirement is valid only when the FPROTECT_BLOCK_SIZE is bigger than
157+
the flash memory page size.
158+
137159
if CHIP_FACTORY_DATA_BUILD
138160

139161
# Factory data definitions

config/nrfconnect/chip-module/Kconfig.defaults

+18-8
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ config CHIP_APP_LOG_LEVEL
3737
default 4 # debug
3838

3939
config LOG_DEFAULT_LEVEL
40-
default 2 # warning
40+
default 1 # error
4141

4242
config CHIP_LOG_SIZE_OPTIMIZATION
4343
default y
@@ -50,6 +50,12 @@ config PRINTK_SYNC
5050
config ASSERT
5151
default y
5252

53+
config ASSERT_NO_COND_INFO
54+
default y
55+
56+
config ASSERT_NO_MSG_INFO
57+
default y
58+
5359
config HW_STACK_PROTECTION
5460
default y
5561

@@ -63,9 +69,9 @@ config PTHREAD_IPC
6369
bool
6470
default n
6571

66-
# Generic networking options
67-
config NET_SOCKETS_POSIX_NAMES
68-
default n
72+
config POSIX_MAX_FDS
73+
int
74+
default 16
6975

7076
# Application stack size
7177
config MAIN_STACK_SIZE
@@ -216,14 +222,18 @@ endif
216222

217223
if CHIP_WIFI
218224

225+
choice WPA_SUPP_LOG_LEVEL_CHOICE
226+
default WPA_SUPP_LOG_LEVEL_ERR
227+
endchoice
228+
219229
config NRF_WIFI_LOW_POWER
220230
default n
221231

222232
config MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
223233
default n
224234

225235
config SYSTEM_WORKQUEUE_STACK_SIZE
226-
default 2048
236+
default 2560
227237

228238
# align these numbers to match the OpenThread config
229239
config NET_IF_UNICAST_IPV6_ADDR_COUNT
@@ -232,9 +242,6 @@ config NET_IF_UNICAST_IPV6_ADDR_COUNT
232242
config NET_IF_MCAST_IPV6_ADDR_COUNT
233243
default 8
234244

235-
config NET_SOCKETS_POSIX_NAMES
236-
default n
237-
238245
config NET_SOCKETS_POLL_MAX
239246
default 4
240247

@@ -436,6 +443,9 @@ endif # SOC_SERIES_NRF52X
436443

437444
if SOC_SERIES_NRF53X
438445

446+
config BOOT_IMAGE_ACCESS_HOOKS
447+
default y
448+
439449
config UPDATEABLE_IMAGE_NUMBER
440450
default 2
441451

config/nrfconnect/chip-module/Kconfig.features

+71-12
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if CHIP
2121

2222
config CHIP_WIFI
2323
bool "Enable nrfconnect Wi-Fi support"
24-
default y if SHIELD_NRF7002_EK || BOARD_NRF7002DK_NRF5340_CPUAPP
24+
default y if SHIELD_NRF7002EK || BOARD_NRF7002DK_NRF5340_CPUAPP
2525
select WIFI_NRF700X
2626
select WIFI
2727
select WPA_SUPP
@@ -73,29 +73,88 @@ config SPI_NOR_FLASH_LAYOUT_PAGE_SIZE
7373

7474
endif # CHIP_SPI_NOR
7575

76+
config CHIP_NUS
77+
bool "Enable Nordic UART service for Matter purposes"
78+
select BT_NUS
79+
select BT_SMP
80+
select BT_NUS_AUTHEN
81+
help
82+
Enables Nordic UART service (NUS) for Matter samples.
83+
Using NUS service you can control a Matter sample using pre-defined BLE commands
84+
and do defined operations. The CHIP NUS service can be useful to keep communication
85+
with a smart home device when a connection within Matter network is lost.
86+
87+
if CHIP_NUS
88+
89+
# Requires providing a PIN for each pair request
90+
config BT_BONDABLE
91+
default n
92+
93+
config BT_RX_STACK_SIZE
94+
default 1536
95+
96+
config SYSTEM_WORKQUEUE_STACK_SIZE
97+
default 2048
98+
99+
config BT_DEVICE_APPEARANCE
100+
default 833
101+
102+
if !LOG
103+
104+
config BT_FIXED_PASSKEY
105+
default y
106+
107+
endif
108+
109+
config CHIP_NUS_MAX_COMMAND_LEN
110+
int "Maximum length of single command in Bytes"
111+
default 10
112+
help
113+
Maximum length of single command. This command will be send via Bluetooth LE to
114+
a paired smart home device.
115+
116+
config CHIP_NUS_FIXED_PASSKEY
117+
int "Define the default passkey for NUS"
118+
depends on BT_FIXED_PASSKEY
119+
default 123456
120+
help
121+
Define the default password for pairing with the Bluetooth LE device.
122+
123+
config CHIP_NUS_MAX_COMMANDS
124+
int "Define maximum NUS commands amount"
125+
default 2
126+
help
127+
Define the maximum number of NUS commands to declare by user.
128+
129+
endif
130+
131+
76132
config CHIP_DFU_OVER_BT_SMP
77133
bool "Enable DFU over Bluetooth LE SMP feature set"
78134
imply CHIP_QSPI_NOR if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF52840DK_NRF52840
79135
imply CHIP_SPI_NOR if BOARD_NRF7002DK_NRF5340_CPUAPP
80136
imply BOOTLOADER_MCUBOOT
81137
select MCUMGR
82-
select MCUMGR_SMP_BT
83-
select MCUMGR_CMD_IMG_MGMT
84-
select MCUMGR_CMD_OS_MGMT
138+
select MCUMGR_TRANSPORT_BT
139+
select IMG_MANAGER
140+
select STREAM_FLASH
141+
select ZCBOR
142+
select MCUMGR_GRP_IMG
143+
select MCUMGR_GRP_OS
85144
# Enable custom SMP request to erase settings partition.
86-
select MCUMGR_GRP_ZEPHYR_BASIC
87-
select MCUMGR_GRP_BASIC_CMD_STORAGE_ERASE
145+
select MCUMGR_GRP_ZBASIC
146+
select MCUMGR_GRP_ZBASIC_STORAGE_ERASE
88147
help
89148
Enables Device Firmware Upgrade over Bluetooth LE with SMP and configures
90149
the set of options related to that feature.
91150

92151
if CHIP_DFU_OVER_BT_SMP
93152

94153
# MCU Manager and SMP configuration
95-
config MCUMGR_SMP_BT_AUTHEN
154+
config MCUMGR_TRANSPORT_BT_AUTHEN
96155
default n
97156

98-
config MCUMGR_BUF_COUNT
157+
config MCUMGR_TRANSPORT_NETBUF_COUNT
99158
default 6
100159

101160
config MCUMGR_MGMT_NOTIFICATION_HOOKS
@@ -117,8 +176,8 @@ config BT_L2CAP_TX_MTU
117176
config BT_BUF_ACL_RX_SIZE
118177
default 502
119178

120-
# Increase MCUMGR_BUF_SIZE, as it must be big enough to fit MAX MTU + overhead and for single-image DFU default is 384 B
121-
config MCUMGR_BUF_SIZE
179+
# Increase MCUMGR_TRANSPORT_NETBUF_SIZE, as it must be big enough to fit MAX MTU + overhead and for single-image DFU default is 384 B
180+
config MCUMGR_TRANSPORT_NETBUF_SIZE
122181
default 1024
123182

124183
# Increase system workqueue size, as SMP is processed within it
@@ -128,10 +187,10 @@ config SYSTEM_WORKQUEUE_STACK_SIZE
128187
if SOC_SERIES_NRF53X
129188

130189
# Enable custom SMP request to erase settings partition.
131-
config MCUMGR_GRP_ZEPHYR_BASIC
190+
config MCUMGR_GRP_ZBASIC
132191
default y
133192

134-
config MCUMGR_GRP_BASIC_CMD_STORAGE_ERASE
193+
config MCUMGR_GRP_ZBASIC_STORAGE_ERASE
135194
default y
136195

137196
endif # SOC_SERIES_NRF53X

config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.defaults

-3
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,5 @@ config EXCEPTION_STACK_TRACE
7575
config NRF_802154_SER_RADIO
7676
default y
7777

78-
config NRF_RTC_TIMER_USER_CHAN_COUNT
79-
default 2
80-
8178
config NRF_802154_ENCRYPTION
8279
default y

config/zephyr/Kconfig

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ menuconfig CHIP
2222
imply REQUIRES_FULL_LIBC
2323
imply NEWLIB_LIBC_NANO
2424
imply CBPRINTF_LIBC_SUBSTS
25-
imply POSIX_API if !ARCH_POSIX
25+
imply POSIX_API if !ARCH_POSIX && !CHIP_NRF_PLATFORM
2626
imply EVENTFD if !ARCH_POSIX
2727
imply REBOOT
2828
imply ENTROPY_GENERATOR
2929
imply NET_UDP
3030
imply NET_IPV6
3131
imply NET_CONFIG_NEED_IPV6
3232
imply NET_SOCKETS
33+
imply NET_SOCKETS_POSIX_NAMES if !ARCH_POSIX && CHIP_NRF_PLATFORM
3334
imply NETWORKING
3435
imply HWINFO
3536
imply FLASH

config/zephyr/chip-module/Kconfig.features

+7-7
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ config MCUMGR
2424
bool
2525
default y
2626

27-
config MCUMGR_CMD_IMG_MGMT
27+
config MCUMGR_GRP_IMG
2828
bool
2929
default y
3030

31-
config MCUMGR_CMD_OS_MGMT
31+
config MCUMGR_GRP_OS
3232
bool
3333
default y
3434

35-
config MCUMGR_SMP_BT
35+
config MCUMGR_TRANSPORT_BT
3636
bool
3737
default y
3838

39-
config MCUMGR_SMP_BT_AUTHEN
39+
config MCUMGR_TRANSPORT_BT_AUTHEN
4040
bool
4141
default n
4242

43-
config MCUMGR_BUF_COUNT
43+
config MCUMGR_TRANSPORT_NETBUF_COUNT
4444
int
4545
default 6
4646

@@ -53,8 +53,8 @@ config BT_BUF_ACL_RX_SIZE
5353
int
5454
default 502
5555

56-
# Increase MCUMGR_BUF_SIZE, as it must be big enough to fit MAX MTU + overhead and for single-image DFU default is 384 B
57-
config MCUMGR_BUF_SIZE
56+
# Increase MCUMGR_TRANSPORT_NETBUF_SIZE, as it must be big enough to fit MAX MTU + overhead and for single-image DFU default is 384 B
57+
config MCUMGR_TRANSPORT_NETBUF_SIZE
5858
int
5959
default 1024
6060

0 commit comments

Comments
 (0)