Skip to content

Commit bfe87de

Browse files
Damian-Nordicmarkaj-nordickkasperczyk-norestyled-commitsandy31415
authored
[nrfconnect] Bump nRF Connect SDK to 2.2.0 (#24302)
* [nrfconnect] Bump nRF Connect SDK to 2.2.0 Change the recommended nRF Connect SDK version to v2.2.0. * Start using Zephyr WiFi net_mgmt API and events - replace wpa_supplicant API calls with generic Zephyr net_mgmt API - use net events to manage WiFi connection - refactoring of the whole platform/nrfconnect/wifi code Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> * Implemented proper handling of WiFi security modes. With the current net_mgmt API it is necessary to scan networks to get the security mode supported by an AP which we want to connect with. Also fixed the invalid handling of net_mgmt event life time. Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> * Aligned Matter SDK to Zephyr 0.15.x revision. These changes were implied the the recent Zephyr upmerge: - updates of Zephyr include paths - removal of disabling of gpio1 in board DTS overlays - fix for the possible dangling pointer compilation error after gcc got more picky about that (v10.3 vs. v12.1) Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> * Increased the max number of BLE connections. This is a workaround for the non-unreferenced BLE connection object when restarting advertising in BLE disconnect callback. Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> * WiFi fail-safe related fixes Make sure the fail-safe works as expected with WiFi networking: - disconnect when reverting the configuration - always cleanup the provisioning data structures before connecting to avoid dummy buffer overwriting and data length issues Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> * Introduced a workaround to send Router Solicitation after connect Router Solicitation is not sent after connecting to the Wi-Fi network by the Wi-Fi driver, so in result Thread Border Router doesn't send Router Advertisement to the device. As a workaround sending RS was added in the Matter platform code. * Forward the channel number and RSSI from WIFiManager. We can now use this feature in spite of stats still not being implemented. Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> * Minor fixes for heap usage Fix build with CHIP_MALLOC_SYS_HEAP Kconfig option that replaces default malloc/free with alternatives based on Zephyr's sys_heap. Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no> * Wi-Fi status handling fixes. * Increase the SYSTEM_WORKQUEUE_STACK_SIZE to match supplicant needs * Decrease the connection timeout to be lower than failsafe (35s) * Adapt WiFiRequestStatus to follow supplicant implementation * All of above makes the failsafe more robust Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> * wifi: RevertConfiguration optimization. Do not disconnect/reconnect to the already attached network. Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> * Define _DEFAULT_SOURCE This commit updates the chip-module build configurations to define `_DEFAULT_SOURCE` when compiling Matter because it uses non-standard functions that are only available when `_DEFAULT_SOURCE` is defined. Note that this used to be not necessary only because of a quirk in the way Newlib handles the feature test macro, which resulted in Newlib defining `_DEFAULT_SOURCE` when compiling with `-std=gnu`. For more details, refer to the issue zephyrproject-rtos/zephyr#52739. * Align examples with samples included in nRF Connect SDK 2.2.0 * Update remaining Docker images to 0.6.27 * Restyled by clang-format * Restyled by shellharden Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no> Co-authored-by: Marcin Kajor <marcin.kajor@nordicsemi.no> Co-authored-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no> Co-authored-by: Restyled.io <commits@restyled.io> Co-authored-by: Andrei Litvin <andy314@gmail.com>
1 parent fa8e279 commit bfe87de

File tree

64 files changed

+534
-517
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

+534
-517
lines changed

.github/workflows/chef.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ jobs:
8585
if: github.actor != 'restyled-io[bot]'
8686

8787
container:
88-
# TODO: update this to connectedhomeip/chip-build-vscode:0.6.30 once we can compile with latest NRF
89-
image: connectedhomeip/chip-build-nrf-platform:0.6.18
88+
image: connectedhomeip/chip-build-nrf-platform:0.6.30
9089
options: --user root
9190

9291
steps:

.github/workflows/examples-nrfconnect.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ jobs:
8383
path: |
8484
.environment/gn_out/.ninja_log
8585
.environment/pigweed-venv/*.log
86-
- name: Update nRF Connect SDK revision to the currently recommended.
86+
- name: Check nRF Connect SDK revision.
8787
timeout-minutes: 15
88-
run: scripts/run_in_build_env.sh "python3 scripts/setup/nrfconnect/update_ncs.py --update --shallow"
88+
run: scripts/run_in_build_env.sh "python3 scripts/setup/nrfconnect/update_ncs.py --check"
8989
- name: Run unit tests of factory data generation script
9090
timeout-minutes: 15
9191
run: scripts/run_in_build_env.sh "./scripts/tools/nrfconnect/tests/test_generate_factory_data.py"

.github/workflows/lint.yml

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

3030
container:
31-
image: connectedhomeip/chip-build:0.6.18
31+
image: connectedhomeip/chip-build:0.6.27
3232

3333
steps:
3434
- uses: Wandalen/wretry.action@v1.0.36
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.1.1
1+
v2.2.0

config/nrfconnect/chip-module/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ set(CHIP_GN_ROOT_TARGET ${CHIP_ROOT}/config/nrfconnect/chip-gn)
9292

9393
# Prepare compiler flags
9494

95+
list(APPEND CHIP_CFLAGS -D_DEFAULT_SOURCE)
96+
9597
if (CONFIG_ARM)
9698
list(APPEND CHIP_CFLAGS_C
9799
--specs=nosys.specs
@@ -309,6 +311,7 @@ add_dependencies(chip-gn kernel)
309311

310312
zephyr_interface_library_named(chip)
311313
target_compile_definitions(chip INTERFACE CHIP_HAVE_CONFIG_H)
314+
target_compile_definitions(chip INTERFACE _DEFAULT_SOURCE)
312315
target_include_directories(chip INTERFACE
313316
${CHIP_ROOT}/src
314317
${CHIP_ROOT}/src/include

config/nrfconnect/chip-module/Kconfig.defaults

+9-9
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ config MAIN_STACK_SIZE
7171
config INIT_STACKS
7272
default y
7373

74-
# Disable certain parts of Zephyr IPv6 stack
75-
config NET_IPV6_NBR_CACHE
76-
default n
77-
7874
config NET_IPV6_MLD
7975
default y
8076

@@ -121,7 +117,9 @@ config BT_DEVICE_NAME_MAX
121117
default 15
122118

123119
config BT_MAX_CONN
124-
default 1
120+
default 2 # a workaround for non-unreferenced BLE connection object
121+
# when restaring the BLE advertising in disconnect callback
122+
# TODO: analyze and revert to 1 if proper fix exists
125123

126124
config BT_L2CAP_TX_MTU
127125
default 247
@@ -189,6 +187,11 @@ config NET_L2_OPENTHREAD
189187

190188
if NET_L2_OPENTHREAD
191189

190+
# Disable certain parts of Zephyr IPv6 stack
191+
config NET_IPV6_NBR_CACHE
192+
bool
193+
default n
194+
192195
# Increase the default RX stack size
193196
config IEEE802154_NRF5_RX_STACK_SIZE
194197
default 1024
@@ -204,7 +207,7 @@ config MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
204207
default n
205208

206209
config SYSTEM_WORKQUEUE_STACK_SIZE
207-
default 1120
210+
default 2048
208211

209212
# align these numbers to match the OpenThread config
210213
config NET_IF_UNICAST_IPV6_ADDR_COUNT
@@ -319,9 +322,6 @@ config MBEDTLS_GCM_C
319322
config MBEDTLS_RSA_C
320323
default n
321324

322-
config PSA_WANT_KEY_TYPE_ARIA
323-
default n
324-
325325
config PSA_WANT_KEY_TYPE_CHACHA20
326326
default n
327327

config/zephyr/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ menuconfig CHIP
2020
select CPLUSPLUS
2121
imply LIB_CPLUSPLUS
2222
imply REQUIRES_FULL_LIBC
23+
imply NEWLIB_LIBC_NANO
2324
imply CBPRINTF_LIBC_SUBSTS
2425
imply POSIX_API if !ARCH_POSIX
2526
imply EVENTFD if !ARCH_POSIX

examples/all-clusters-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay

+5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
1414
* limitations under the License.
1515
*/
1616

17+
#include <zephyr/dt-bindings/ipc_service/static_vrings.h>
18+
1719
/ {
1820
chosen {
1921
nordic,pm-ext-flash = &mx25r64;
2022
};
23+
};
2124

25+
&ipc0 {
26+
zephyr,priority = <0 PRIO_COOP>;
2227
};
2328

2429
/* Disable unused peripherals to reduce power consumption */

examples/all-clusters-app/nrfconnect/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
#endif
4646

4747
#include <dk_buttons_and_leds.h>
48+
#include <zephyr/kernel.h>
4849
#include <zephyr/logging/log.h>
49-
#include <zephyr/zephyr.h>
5050

5151
LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL);
5252

examples/all-clusters-minimal-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay

+5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
1414
* limitations under the License.
1515
*/
1616

17+
#include <zephyr/dt-bindings/ipc_service/static_vrings.h>
18+
1719
/ {
1820
chosen {
1921
nordic,pm-ext-flash = &mx25r64;
2022
};
23+
};
2124

25+
&ipc0 {
26+
zephyr,priority = <0 PRIO_COOP>;
2227
};
2328

2429
/* Disable unused peripherals to reduce power consumption */

examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
#endif
3737

3838
#include <dk_buttons_and_leds.h>
39-
#include <logging/log.h>
40-
#include <zephyr.h>
39+
#include <zephyr/kernel.h>
40+
#include <zephyr/logging/log.h>
4141

4242
LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL);
4343

examples/all-clusters-minimal-app/nrfconnect/main/main.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717

1818
#include "AppTask.h"
1919

20-
#include <logging/log.h>
20+
#include <zephyr/logging/log.h>
2121

2222
#if DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_console), zephyr_cdc_acm_uart)
23-
#include <drivers/uart.h>
24-
#include <usb/usb_device.h>
23+
#include <zephyr/drivers/uart.h>
24+
#include <zephyr/usb/usb_device.h>
2525
#endif
2626

2727
LOG_MODULE_REGISTER(app, CONFIG_CHIP_APP_LOG_LEVEL);

examples/common/pigweed/nrfconnect/PigweedLoggerMutex.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "PigweedLogger.h"
2222
#include "pigweed/RpcService.h"
23-
#include <kernel.h>
23+
#include <zephyr/kernel.h>
2424

2525
namespace chip {
2626
namespace rpc {

examples/light-switch-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay

+5
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@
1414
* limitations under the License.
1515
*/
1616

17+
#include <zephyr/dt-bindings/ipc_service/static_vrings.h>
18+
1719
/ {
1820
chosen {
1921
nordic,pm-ext-flash = &mx25r64;
2022
};
23+
};
2124

25+
&ipc0 {
26+
zephyr,priority = <0 PRIO_COOP>;
2227
};

examples/light-switch-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
1817
/ {
1918
chosen {
2019
nordic,pm-ext-flash = &mx25r64;

examples/light-switch-app/nrfconnect/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
#endif
4646

4747
#include <dk_buttons_and_leds.h>
48+
#include <zephyr/kernel.h>
4849
#include <zephyr/logging/log.h>
49-
#include <zephyr/zephyr.h>
5050

5151
LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL);
5252

examples/lighting-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
#include <zephyr/dt-bindings/ipc_service/static_vrings.h>
18+
1719
/ {
1820
chosen {
1921
nordic,pm-ext-flash = &mx25r64;
@@ -34,7 +36,10 @@
3436
pwms = < &pwm0 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
3537
};
3638
};
39+
};
3740

41+
&ipc0 {
42+
zephyr,priority = <0 PRIO_COOP>;
3843
};
3944

4045
&pwm0 {

examples/lighting-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
1817
/ {
1918
chosen {
2019
nordic,pm-ext-flash = &mx25r64;
@@ -32,7 +31,7 @@
3231
pwmleds {
3332
compatible = "pwm-leds";
3433
pwm_led1: pwm_led_1 {
35-
pwms = < &pwm0 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
34+
pwms = < &pwm0 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
3635
};
3736
};
3837
};

examples/lighting-app/nrfconnect/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
#endif
5151

5252
#include <dk_buttons_and_leds.h>
53+
#include <zephyr/kernel.h>
5354
#include <zephyr/logging/log.h>
54-
#include <zephyr/zephyr.h>
5555

5656
LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL);
5757

Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
/*
2-
*
3-
* Copyright (c) 2020 Project CHIP Authors
4-
* All rights reserved.
5-
*
6-
* Licensed under the Apache License, Version 2.0 (the "License");
7-
* you may not use this file except in compliance with the License.
8-
* You may obtain a copy of the License at
9-
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
11-
*
12-
* Unless required by applicable law or agreed to in writing, software
13-
* distributed under the License is distributed on an "AS IS" BASIS,
14-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
* See the License for the specific language governing permissions and
16-
* limitations under the License.
17-
*/
1+
//
2+
// Copyright (c) 2020 Project CHIP Authors
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
1816

1917
#pragma once
2018

@@ -41,5 +39,3 @@
4139
#define FACTORY_RESET_SIGNAL_LED DK_LED3
4240
#define FACTORY_RESET_SIGNAL_LED1 DK_LED4
4341
#endif
44-
// Time it takes in ms for the simulated actuator to move from one state to another.
45-
#define ACTUATOR_MOVEMENT_PERIOS_MS 2000

examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay

+5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
1414
* limitations under the License.
1515
*/
1616

17+
#include <zephyr/dt-bindings/ipc_service/static_vrings.h>
18+
1719
/ {
1820
chosen {
1921
nordic,pm-ext-flash = &mx25r64;
2022
};
23+
};
2124

25+
&ipc0 {
26+
zephyr,priority = <0 PRIO_COOP>;
2227
};
2328

2429
/* Disable unused peripherals to reduce power consumption */

examples/lock-app/nrfconnect/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
#endif
4949

5050
#include <dk_buttons_and_leds.h>
51+
#include <zephyr/kernel.h>
5152
#include <zephyr/logging/log.h>
52-
#include <zephyr/zephyr.h>
5353

5454
LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL);
5555

examples/lock-app/nrfconnect/main/include/BoltLockManager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <lib/core/ClusterEnums.h>
2424
#include <lib/support/ScopedBuffer.h>
2525

26-
#include <zephyr/zephyr.h>
26+
#include <zephyr/kernel.h>
2727

2828
#include <cstdint>
2929

examples/pigweed-app/nrfconnect/main/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "LEDWidget.h"
2020
#include "PigweedLoggerMutex.h"
2121
#include "pigweed/RpcService.h"
22-
#include <kernel.h>
22+
#include <zephyr/kernel.h>
2323

2424
#include "pw_rpc/echo_service_nanopb.h"
2525
#include "pw_sys_io/sys_io.h"

examples/platform/nrfconnect/pw_sys_io/sys_io_nrfconnect.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
#include <cinttypes>
1919

20-
#include "console/console.h"
2120
#include "pw_sys_io/sys_io.h"
2221
#include <cassert>
22+
#include <zephyr/console/console.h>
2323
#include <zephyr/zephyr.h>
2424

2525
#ifdef CONFIG_USB

examples/platform/nrfconnect/util/LEDWidget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "LEDWidget.h"
2121

2222
#include <dk_buttons_and_leds.h>
23-
#include <zephyr/zephyr.h>
23+
#include <zephyr/kernel.h>
2424

2525
static LEDWidget::LEDWidgetStateUpdateHandler sStateUpdateCallback;
2626

examples/platform/nrfconnect/util/PWMDevice.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#include <lib/support/CodeUtils.h>
2424

2525
#include <zephyr/drivers/pwm.h>
26+
#include <zephyr/kernel.h>
2627
#include <zephyr/logging/log.h>
27-
#include <zephyr/zephyr.h>
2828

2929
LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL);
3030

0 commit comments

Comments
 (0)