Skip to content

Commit af8d173

Browse files
axelnxpyeaissa
andauthored
[NXP][Zephyr] Migrate to nxp-zsdk v4.0.0 (#36749)
- Kconfigs/CMake updates for nxp-zsdk v4.0.0 (Zephyr 4.0 base) - Add ThreadMetrics support for Zephyr platforms - Add missing WiFi Diagnostic support for NXP Zephyr - Add Matter over WiFi support for frdm_rw612 - Update and fix memory overlays Restyled by clang-format Restyled by prettier-markdown Co-authored-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
1 parent 84fb78f commit af8d173

24 files changed

+630
-91
lines changed

.github/workflows/examples-nxp.yaml

+2-2
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: ghcr.io/project-chip/chip-build-nxp:93
43+
image: ghcr.io/project-chip/chip-build-nxp:94
4444
volumes:
4545
- "/tmp/bloat_reports:/tmp/bloat_reports"
4646
steps:
@@ -240,7 +240,7 @@ jobs:
240240
if: github.actor != 'restyled-io[bot]'
241241

242242
container:
243-
image: ghcr.io/project-chip/chip-build-nxp-zephyr:93
243+
image: ghcr.io/project-chip/chip-build-nxp-zephyr:94
244244

245245
steps:
246246
- name: Checkout

config/nxp/chip-module/Kconfig.defaults

+14-2
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,15 @@ choice SCHED_ALGORITHM
252252
default SCHED_MULTIQ
253253
endchoice
254254

255+
config WIFI_NM_MAX_MANAGED_INTERFACES
256+
default 2
257+
258+
config WIFI_NM_WPA_SUPPLICANT_WQ_PRIO
259+
default 3
260+
261+
config WIFI_NM_WPA_SUPPLICANT_PRIO
262+
default 3
263+
255264
choice WIFI_NM_WPA_SUPPLICANT_LOG_LEVEL_CHOICE
256265
default WIFI_NM_WPA_SUPPLICANT_LOG_LEVEL_INF
257266
endchoice
@@ -320,6 +329,9 @@ config HEAP_MEM_POOL_SIZE
320329
config CHIP_MALLOC_SYS_HEAP_SIZE
321330
default 28672 # 28 kB
322331

332+
config ETH_DRIVER
333+
default n
334+
323335
endif
324336

325337
if CHIP_ETHERNET || CHIP_WIFI
@@ -354,10 +366,10 @@ config MBEDTLS_USER_CONFIG_ENABLE
354366
config MBEDTLS_USER_CONFIG_FILE
355367
default "nxp-zephyr-mbedtls-config.h"
356368

357-
config MBEDTLS_ENTROPY_ENABLED
369+
config MBEDTLS_ENTROPY_C
358370
default y
359371

360-
config MBEDTLS_ZEPHYR_ENTROPY
372+
config MBEDTLS_ENTROPY_POLL_ZEPHYR
361373
default y
362374

363375
config MBEDTLS_SSL_MAX_CONTENT_LEN

examples/all-clusters-app/nxp/zephyr/README.md

+37-29
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ The example supports:
3838
The supported boards are:
3939

4040
- `rd_rw612_bga`
41+
- `frdm_rw612`
4142

4243
<a name="building"></a>
4344

@@ -51,23 +52,23 @@ Prerequisites:
5152
- Follow instruction from [BUILDING.md](../../../../docs/guides/BUILDING.md)
5253
to setup the Matter environment
5354
- Follow instruction from
54-
[Getting Started Guide](https://docs.zephyrproject.org/3.7.0/develop/getting_started/index.html)
55+
[Getting Started Guide](https://docs.zephyrproject.org/4.0.0/develop/getting_started/index.html)
5556
to setup a Zephyr workspace, however, the west init command to use is as
5657
follows:
5758

5859
```shell
59-
$ west init zephyrproject -m https://github.com/nxp-zephyr/nxp-zsdk.git --mr nxp-v3.7.0
60+
$ west init zephyrproject -m https://github.com/nxp-zephyr/nxp-zsdk.git --mr nxp-v4.0.0
6061
```
6162

6263
> **Note**: While some of NXP platforms are supported in Zephyr upstream, we
6364
> recommend using nxp-zsdk downstream to get access to all NXP features that are
6465
> not upstream yet. While you can decide to use nxp-zsdk top of tree, we
6566
> recommend using a proper release tag delivered by NXP. This will ensure a
6667
> certain level of quality of the nxp-zsdk in use. Currently, we highly
67-
> recommend using the `nxp-v3.7.0` tag, based on Zephyr 3.7 LTS release. Reach
68-
> to your NXP contact for more details.
68+
> recommend using the `nxp-v4.0.0` tag, based on Zephyr 4.0 release. Reach to
69+
> your NXP contact for more details.
6970
70-
Steps to build the example, targeting `rd_rw612_bga` board:
71+
Steps to build the example:
7172

7273
1. Activate your Matter env:
7374

@@ -84,7 +85,13 @@ source <path to zephyr repo>/zephyr-env.sh
8485
3. Run west build command:
8586

8687
```shell
87-
west build -b rd_rw612_bga -p auto -d build_zephyr <path to example folder>
88+
west build -b <board> -p auto -d build_zephyr <path to example folder>
89+
```
90+
91+
As an example with the `frdm_rw612` board:
92+
93+
```shell
94+
west build -b frdm_rw612 -p auto -d build_zephyr examples/all-clusters-app/nxp/zephyr
8895
```
8996

9097
A folder `build_zephyr` will be created in the same folder you run the command
@@ -102,7 +109,7 @@ You can get more details on `west build` with
102109

103110
### Flashing without debugging
104111

105-
`west` can be used to flash a target, as an example for `rd_rw612_bga` board:
112+
`west` can be used to flash a target:
106113

107114
```shell
108115
west flash -i <J-Link serial number>
@@ -132,30 +139,30 @@ To debug a Matter with Zephyr application, you could use several methods:
132139
NXP Zephyr examples are not using factory data support by default. Please refer
133140
the the section below to build with factory data.
134141

135-
You may refer to `src/platform/nxp/zephyr/boards/<board>/<board>.overlay` file
136-
to obtain the memory region used by this partition.
142+
You may refer to `<board>.overlay` file in each examples boards folder to obtain
143+
the memory region used by this partition.
137144

138-
For example, the factory data partition on `rd_rw612_bga` is reserved in the
139-
last sector of the `flexspi` flash of `RD BGA` board, at `0x1BFFF000`.
145+
For example, the factory data partition on `frdm_rw612` is reserved in the last
146+
sector of the `flexspi` flash, at `0x1BFFF000`.
140147

141148
```
142-
&flexspi {
143-
status = "okay";
149+
w25q512jvfiq: w25q512jvfiq@0 {
150+
status = "okay";
151+
152+
partitions {
153+
...
154+
factory_partition: partition@3FFF000 {
155+
label = "factory-data";
156+
reg = <0x03FFF000 DT_SIZE_K(4)>;
157+
};
144158
145-
mx25u51245g: mx25u51245g@0 {
146-
...
147-
factory_partition: partition@3FFF000 {
148-
label = "factory-data";
149-
reg = <0x03FFF000 DT_SIZE_K(4)>;
150-
};
151-
};
159+
};
152160
};
153161
```
154162

155-
> **Note**: You may also refer to
156-
> `src/platform/nxp/zephyr/boards/<board>/<board>.overlay` file to check other
157-
> memory partitions used by the platform, such as the file system partition
158-
> mentioned with the `storage` label.
163+
> **Note**: You may also refer to `<board>.overlay` file in each NXP Zephyr
164+
> examples folder to check other memory partitions used by the platform, such as
165+
> the file system partition mentioned with the `storage` label.
159166
160167
### Build with factory data support
161168

@@ -165,7 +172,7 @@ To build the example with factory data support, you can add
165172
Example:
166173

167174
```bash
168-
west build -b rd_rw612_bga -p <path to example folder> -- -DFILE_SUFFIX=fdata
175+
west build -b <board> -p <path to example folder> -- -DFILE_SUFFIX=fdata
169176
```
170177

171178
`prj_fdata.conf` configuration file will enable `CONFIG_CHIP_FACTORY_DATA`
@@ -233,13 +240,14 @@ configured for the example. The binding `zephyr,console` is used to print the
233240
logs, while the binding `zephyr,shell-uart` is used for the CLI. If the logs and
234241
the CLI are split among two serial interfaces, you will have to open both ports.
235242

236-
As an example, the Matter CLI on `rd_rw612_bga` is configured to be output on
243+
As an example, the Matter CLI on `frdm_rw612` is configured to be output on
237244
`flexcomm3` with a baudrate of `115200`. The logs are configured to be output on
238245
`flexcomm0` with a baudrate of `115200`.
239246

240-
> **Note**: `flexcomm3` is wired to the USB `FTDI` port of the `RD BGA` board by
241-
> default. `flexcomm0` is wired to `GPIO2` (RX) and `GPIO3` (TX). Those pins are
242-
> accessible on `HD2` pin header.
247+
> **Note**: `frdm_rw612` and ` frdm_rw612``flexcomm3 ` is wired to the USB
248+
> `MCULINK` port of the board by default. `rd_rw612_bga` `flexcomm0` is wired to
249+
> `GPIO2` (RX) and `GPIO3` (TX). Those pins are accessible on `HD2` pin header.
250+
> `frdm_rw612` `flexcomm0` is wired to RX and TX pins located at `J5 mikroBUS`.
243251
244252
To access the CLI console, use a serial terminal emulator of your choice, like
245253
Minicom or GNU Screen. Use the baud rate set to `115200`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Copyright (c) 2024 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+
#
16+
17+
# Workaround for nxp-zsdk v4.0.0 release
18+
CONFIG_FLASH_LOAD_SIZE=0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
* Copyright (c) 2024 Project CHIP Authors
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http: //www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/ {
19+
chosen {
20+
zephyr,console = &flexcomm0;
21+
zephyr,shell-uart = &flexcomm3;
22+
};
23+
};
24+
25+
&flexcomm0 {
26+
compatible = "nxp,lpc-usart";
27+
status = "okay";
28+
current-speed = <115200>;
29+
pinctrl-0 = <&pinmux_flexcomm0_usart>;
30+
pinctrl-names = "default";
31+
};
32+
33+
&flexcomm3 {
34+
compatible = "nxp,lpc-usart";
35+
status = "okay";
36+
current-speed = <115200>;
37+
pinctrl-0 = <&pinmux_flexcomm3_usart>;
38+
pinctrl-names = "default";
39+
};
40+
41+
/delete-node/ &sram_data;
42+
/delete-node/ &sram_code;
43+
/delete-node/ &boot_partition;
44+
/delete-node/ &slot0_partition;
45+
/delete-node/ &slot1_partition;
46+
/delete-node/ &storage_partition;
47+
48+
&sram {
49+
#address-cells = <1>;
50+
#size-cells = <1>;
51+
52+
sram_data: memory@0 {
53+
compatible = "mmio-sram";
54+
reg = <0x0 DT_SIZE_K(1216)>;
55+
};
56+
};
57+
58+
&flexspi {
59+
status = "okay";
60+
61+
w25q512jvfiq: w25q512jvfiq@0 {
62+
status = "okay";
63+
64+
partitions {
65+
boot_partition: partition@0 {
66+
label = "mcuboot";
67+
reg = <0x00000000 DT_SIZE_K(128)>;
68+
};
69+
70+
slot0_partition: partition@20000 {
71+
label = "image-0";
72+
reg = <0x00020000 0x440000>;
73+
};
74+
75+
slot1_partition: partition@460000 {
76+
label = "image-1";
77+
reg = <0x00460000 0x440000>;
78+
};
79+
80+
storage_partition: partition@3FEF000 {
81+
label = "storage";
82+
reg = <0x03FEF000 DT_SIZE_K(64)>;
83+
};
84+
85+
factory_partition: partition@3FFF000 {
86+
label = "factory-data";
87+
reg = <0x03FFF000 DT_SIZE_K(4)>;
88+
};
89+
90+
};
91+
};
92+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# Copyright (c) 2024 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+
#
16+
17+
CONFIG_SETTINGS_NVS_SECTOR_COUNT=16
18+
19+
# 0xA226
20+
CONFIG_CHIP_DEVICE_PRODUCT_ID=41510
21+
CONFIG_CHIP_DEVICE_PRODUCT_URL="https://www.nxp.com/design/design-center/development-boards-and-designs/general-purpose-mcus/frdm-development-board-for-rw612-wi-fi-6-plus-bluetooth-low-energy-plus-802-15-4-tri-radio-wireless-mcu:FRDM-RW612"
22+
CONFIG_CHIP_DEVICE_PRODUCT_LABEL="RW612"
23+
CONFIG_CHIP_DEVICE_PART_NUMBER="RW612"
24+
25+
# Workaround for nxp-zsdk v4.0.0 release
26+
CONFIG_FLASH_LOAD_SIZE=0

examples/all-clusters-app/nxp/zephyr/boards/rd_rw612_bga.overlay

+9-7
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,23 @@
3838
pinctrl-names = "default";
3939
};
4040

41+
/delete-node/ &sram_data;
42+
/delete-node/ &sram_code;
43+
/delete-node/ &boot_partition;
44+
/delete-node/ &slot0_partition;
45+
/delete-node/ &slot1_partition;
46+
/delete-node/ &storage_partition;
47+
4148
&sram {
4249
#address-cells = <1>;
4350
#size-cells = <1>;
4451

45-
sram_data: memory@40000 {
52+
sram_data: memory@0 {
4653
compatible = "mmio-sram";
47-
reg = <0x40000 DT_SIZE_K(1216)>;
54+
reg = <0x0 DT_SIZE_K(1216)>;
4855
};
4956
};
5057

51-
/delete-node/ &boot_partition;
52-
/delete-node/ &slot0_partition;
53-
/delete-node/ &slot1_partition;
54-
/delete-node/ &fw_storage;
55-
/delete-node/ &storage_partition;
5658

5759
&flexspi {
5860
status = "okay";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Copyright (c) 2024 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+
#
16+
17+
# Workaround for nxp-zsdk v4.0.0 release
18+
CONFIG_FLASH_LOAD_SIZE=0

0 commit comments

Comments
 (0)