Skip to content

Commit 3f9c68e

Browse files
Merge branch 'master' into feature/timed-lcd-icd-cluster
2 parents 2ea2f43 + 83dc1c8 commit 3f9c68e

File tree

273 files changed

+6754
-3557
lines changed

Some content is hidden

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

273 files changed

+6754
-3557
lines changed

.restyled.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ exclude:
7272
- "scripts/tools/zap/tests/outputs/**/*" # Matches generated output 1:1
7373
- "examples/chef/sample_app_util/test_files/*.yaml"
7474
- "examples/chef/zzz_generated/**/*"
75-
- "examples/platform/nxp/k32w/k32w0/scripts/demo_generated_certs/**/*"
7675
- "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/*" # zap-generated files
7776
- "integrations/cloudbuild/*.yaml" # uglier long command line content
7877
- "scripts/run_codegen_targets.sh" # shellharden breaks for loops over command outputs

BUILD.gn

+3-3
Original file line numberDiff line numberDiff line change
@@ -689,23 +689,23 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
689689

690690
if (enable_k32w_lighting_app_build) {
691691
group("k32w_lighting_app") {
692-
deps = [ "${chip_root}/examples/lighting-app/nxp/k32w/k32w0/(${chip_root}/config/k32w/toolchain:k32w_lighting_app)" ]
692+
deps = [ "${chip_root}/examples/lighting-app/nxp/k32w0/(${chip_root}/config/k32w/toolchain:k32w_lighting_app)" ]
693693
}
694694

695695
extra_build_deps += [ ":k32w_lighting_app" ]
696696
}
697697

698698
if (enable_k32w_lock_app_build) {
699699
group("k32w_lock_app") {
700-
deps = [ "${chip_root}/examples/lock-app/nxp/k32w/k32w0/(${chip_root}/config/k32w/toolchain:k32w_lock_app)" ]
700+
deps = [ "${chip_root}/examples/lock-app/nxp/k32w0/(${chip_root}/config/k32w/toolchain:k32w_lock_app)" ]
701701
}
702702

703703
extra_build_deps += [ ":k32w_lock_app" ]
704704
}
705705

706706
if (enable_k32w_shell_app_build) {
707707
group("k32w_shell_app") {
708-
deps = [ "${chip_root}/examples/shell/nxp/k32w/k32w0/(${chip_root}/config/k32w/toolchain:k32w_shell_app)" ]
708+
deps = [ "${chip_root}/examples/shell/nxp/k32w0/(${chip_root}/config/k32w/toolchain:k32w_shell_app)" ]
709709
}
710710

711711
extra_build_deps += [ ":k32w_shell_app" ]

build/config/compiler/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ config("libfuzzer_fuzzing") {
489489

490490
config("oss_fuzz") {
491491
cflags = string_split(getenv("CFLAGS"))
492+
cflags_cc = string_split(getenv("CXXFLAGS"))
492493
ldflags = string_split(getenv("CXXFLAGS"))
493494
ldflags += [ getenv("LIB_FUZZING_ENGINE") ]
494495
}

config/k32w/toolchain/BUILD.gn

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,27 @@ import("${build_root}/toolchain/arm_gcc/arm_toolchain.gni")
2020
arm_toolchain("k32w_lighting_app") {
2121
toolchain_args = {
2222
current_os = "freertos"
23-
import("${chip_root}/examples/lighting-app/nxp/k32w/k32w0/args.gni")
23+
import("${chip_root}/examples/lighting-app/nxp/k32w0/args.gni")
2424
}
2525
}
2626

2727
arm_toolchain("k32w_lock_app") {
2828
toolchain_args = {
2929
current_os = "freertos"
30-
import("${chip_root}/examples/lock-app/nxp/k32w/k32w0/args.gni")
30+
import("${chip_root}/examples/lock-app/nxp/k32w0/args.gni")
3131
}
3232
}
3333

3434
arm_toolchain("k32w_contact_sensor_app") {
3535
toolchain_args = {
3636
current_os = "freertos"
37-
import("${chip_root}/examples/contact-sensor-app/nxp/k32w/k32w0/args.gni")
37+
import("${chip_root}/examples/contact-sensor-app/nxp/k32w0/args.gni")
3838
}
3939
}
4040

4141
arm_toolchain("k32w_shell_app") {
4242
toolchain_args = {
4343
current_os = "freertos"
44-
import("${chip_root}/examples/shell/nxp/k32w/k32w0/args.gni")
44+
import("${chip_root}/examples/shell/nxp/k32w0/args.gni")
4545
}
4646
}

docs/QUICK_START.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ and platforms.
1717
Use one of the controllers listed above and then a Border Router and Node
1818
combination listed below.
1919

20-
| <div style="width:200px">Border Router</div> | <div style="width:200px">Node</div> | Description |
21-
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
22-
| [**ot-br**](https://openthread.io/guides/border-router/build)<br>Thread Border Router <li>RasPi <li>BeagleBone | **lighting-app** <li>[Nordic nRF5x](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/nrfconnect/README.md) <li> [NXP K32W](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/nxp/k32w/k32w0/README.md) <li> [Qorvo QPG6100](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/qpg) <li> [Silicon Labs EFR32](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/silabs/README.md) | The Lighting example is supported by many of the available Thread platforms. See the chip-tool controller instructions for how to actuate the light on/off cluster. |
23-
| [**ot-br**](https://openthread.io/guides/border-router/build)<br>Thread Border Router <li>RasPi <li>BeagleBone | **lock-app** <li>[Nordic nRF5x](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/nrfconnect/README.md) <li> [NXP K32W](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/nxp/k32w/k32w0/README.md) <li> [Qorvo QPG6100](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/qpg) <li> [Silicon Labs EFR32](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/efr32/README.md) <li> [TI CC13x2x7](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/cc13x2x7_26x2x7/README.md) | The Lock example is supported by many of the available Thread and Wi-Fi platforms. |
20+
| <div style="width:200px">Border Router</div> | <div style="width:200px">Node</div> | Description |
21+
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
22+
| [**ot-br**](https://openthread.io/guides/border-router/build)<br>Thread Border Router <li>RasPi <li>BeagleBone | **lighting-app** <li>[Nordic nRF5x](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/nrfconnect/README.md) <li> [NXP K32W](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/nxp/k32w0/README.md) <li> [Qorvo QPG6100](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/qpg) <li> [Silicon Labs EFR32](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/silabs/README.md) | The Lighting example is supported by many of the available Thread platforms. See the chip-tool controller instructions for how to actuate the light on/off cluster. |
23+
| [**ot-br**](https://openthread.io/guides/border-router/build)<br>Thread Border Router <li>RasPi <li>BeagleBone | **lock-app** <li>[Nordic nRF5x](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/nrfconnect/README.md) <li> [Qorvo QPG6100](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/qpg) <li> [Silicon Labs EFR32](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/efr32/README.md) <li> [TI CC13x2x7](https://github.com/project-chip/connectedhomeip/tree/master/examples/lock-app/cc13x2x7_26x2x7/README.md) | The Lock example is supported by many of the available Thread and Wi-Fi platforms. |
2424

2525
## Controllers
2626

+232
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
# NXP K32W0x1 OTA guide
2+
3+
## The Secondary Stage Bootloader (SSBL)
4+
5+
There are multiple SSBL binaries provided by the SDK:
6+
7+
| description | github SDK path | package SDK path |
8+
| ------------------------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
9+
| Default SSBL | NA | `boards/k32w061dk6/wireless_examples/framework/ssbl/binary/ssbl.bin` |
10+
| SSBL with PDM in external flash | `examples/k32w061dk6/wireless_examples/framework/ssbl/binary/ssbl_ext_flash_pdm_support.bin` | `boards/k32w061dk6/wireless_examples/framework/ssbl/binary/ssbl_ext_flash_pdm_support.bin` |
11+
12+
The SSBL is also built alongside the reference application and it can be
13+
configured according to the following table:
14+
15+
| gn arg | default | description |
16+
| --------------------------------- | --------------------------- | ---------------------------------------------------------------------------------------- |
17+
| `ssbl_pdm_external_flash` | true | Enable/disable PDM in external flash |
18+
| `ssbl_multi_image_support` | true | Enable/disable multi-image OTA feature |
19+
| `ssbl_ota_entry_storage` | "OTACustomStorage_ExtFlash" | Configure custom OTA entry storage type |
20+
| `ssbl_simple_hash_verification` | false | Enable/disable simple hash verification alternative to secure boot |
21+
| `ssbl_optimize_spifi_flash` | false | Optimize `SPIFI` flash driver size |
22+
| `ssbl_spifi_dual_mode` | false | Enable/disable `SPIFI` dual mode support (e.g. used by K32W041AM variant) |
23+
| `ssbl_version` | 0 | Set SSBL version |
24+
| `ssbl_use_redlib` | false | Enable/disable usage of `redlib` NXP library. If false, the build will use `newlib` nano |
25+
| `ssbl_ota_data_in_external_flash` | false | Enable/disable OTA support for application with sections stored in external flash |
26+
27+
## Simple hash verification
28+
29+
When secure boot is not used, a simple hash can be appended at the end of the
30+
image for integrity check. Applications should be built with
31+
`chip_simple_hash_verification=1`.
32+
33+
## Writing the SSBL
34+
35+
Before writing the SSBL, it it recommanded to fully erase the internal flash.
36+
37+
Using DK6Programmer utility from Windows:
38+
39+
```
40+
DK6Programmer.exe -V 5 -P 1000000 -s <COM_PORT> -e Flash
41+
```
42+
43+
Using `dk6prog` from `SPSDK`:
44+
45+
```
46+
$ dk6prog listdev
47+
This is an experimental utility. Use with caution!
48+
49+
List of available devices:
50+
DEVICE ID: DN038ZH3, VID: 0x403, PID: 0x6015, Serial number: DN038ZH3, Description: DK6 Carrier Board, Address: 9, Backend: Backend.PYFTDI
51+
$ dk6prog -d DN038ZH3 erase 0 0x9de00
52+
53+
This is an experimental utility. Use with caution!
54+
55+
Erasing memory [####################################] 100%
56+
```
57+
58+
`chip-k32w0x-ssbl.bin` must be written at address 0 in the internal flash:
59+
60+
Using DK6Programmer utility from Windows:
61+
62+
```
63+
DK6Programmer.exe -V2 -s <COM_PORT> -P 1000000 -Y -p FLASH@0x00="chip-k32w0x-ssbl.bin"
64+
```
65+
66+
Using `dk6prog` from `SPSDK`:
67+
68+
```
69+
$ dk6prog -d DN038ZH3 write 0 ~/path/to/bin/chip-k32w0x-ssbl.bin
70+
71+
This is an experimental utility. Use with caution!
72+
73+
Writing memory [####################################] 100%
74+
Written 7890 bytes to memory ID 0 at address 0x0
75+
```
76+
77+
### Writing the PSECT
78+
79+
This is the list of all supported partitions:
80+
81+
```
82+
0000000010000000 : SSBL partition
83+
84+
00000000 -----------> Start Address
85+
1000 ---------------> 0x0010 Number of 512-bytes pages
86+
00 -----------------> 0x00 Bootable flag
87+
00 -----------------> 0x00 Image type (0x00 = SSBL)
88+
89+
00400000c9040101: Application partition
90+
91+
00400000 -----------> 0x00004000 Start Address
92+
c904 ---------------> 0x04c9 Number of 512-bytes pages
93+
01 -----------------> 0x01 Bootable flag
94+
01 -----------------> 0x01 Image type (0x01 = Application)
95+
96+
00000010800000fe: Ext Flash text partition
97+
98+
00000010 -----------> 0x10000000 Start Address (external flash)
99+
8000 ---------------> 0x0080 Number of 512-bytes pages
100+
00 -----------------> 0x00 Bootable flag
101+
fe -----------------> 0xFE Image type (0xFE = Ext Flash text)
102+
103+
00000110300200fc : OTA Image partition
104+
105+
00000110 -----------> 0x10010000 Start Address
106+
3002----------------> 0x0230 Number of 512-bytes pages
107+
00 -----------------> 0x00 Bootable flag
108+
fc -----------------> 0xFC Image type (0xFC = OTA partition)
109+
110+
00000510100000fd: NVM partition
111+
112+
00000510 -----------> 0x10050000 Start Address
113+
1000 ---------------> 0x0010 Number of 512-bytes pages
114+
00 -----------------> 0x00 Bootable flag
115+
fd -----------------> 0xFD Image type (0xFD = NVM partition)
116+
```
117+
118+
First, image directory 0 (SSBL partition) must be written:
119+
120+
Using DK6Programmer utility from Windows:
121+
122+
```
123+
DK6Programmer.exe -V5 -s <COM port> -P 1000000 -w image_dir_0=0000000010000000
124+
```
125+
126+
Using `dk6prog` from `SPSDK`:
127+
128+
```
129+
$ dk6prog -d DN038ZH3 write 0x160 [[0000000010000000]] 8 PSECT
130+
131+
This is an experimental utility. Use with caution!
132+
133+
Writing memory [####################################] 100%
134+
Written 8 bytes to memory ID PSECT at address 0x160
135+
```
136+
137+
Here is the interpretation of the fields:
138+
139+
```
140+
00000000 -> start address 0x00000000
141+
1000 -> size = 0x0010 pages of 512-bytes (= 8kB)
142+
00 -> not bootable (only used by the SSBL to support SSBL update)
143+
00 -> SSBL Image Type
144+
```
145+
146+
Second, image directory 1 (application partition) must be written:
147+
148+
Using DK6Programmer utility from Windows:
149+
150+
```
151+
DK6Programmer.exe -V5 -s <COM port> -P 1000000 -w image_dir_1=00400000C9040101
152+
```
153+
154+
Using `dk6prog` from `SPSDK`:
155+
156+
```
157+
$ dk6prog -d DN038ZH3 write 0x168 [[00400000C9040101]] 8 PSECT
158+
159+
This is an experimental utility. Use with caution!
160+
161+
Writing memory [####################################] 100%
162+
Written 8 bytes to memory ID PSECT at address 0x168
163+
```
164+
165+
Here is the interpretation of the fields:
166+
167+
```
168+
00400000 -> start address 0x00004000
169+
C904 -> 0x4C9 pages of 512-bytes (= 612.5kB)
170+
01 -> bootable flag
171+
01 -> image type for the application
172+
```
173+
174+
Please note the user can write additional partitions by writing
175+
`image_dir_2/3/4` with the wanted configuration. In case of using the `SPSDK`
176+
tool, the appropriate offset must be calculated
177+
178+
## Removing SSBL Upgrade Region
179+
180+
The example also offers the possibility to remove SSBL upgrade region, for
181+
reserving more space for application level.
182+
183+
A new flag `chip_reduce_ssbl_size` is introduced. In order to remove the SSBL
184+
upgrade region, `chip_reduce_ssbl_size=true` must be provided to the build
185+
system
186+
187+
The programming method will change:
188+
189+
- Writing image directory 1 should change to Using DK6Programmer utility from
190+
Windows:
191+
192+
```
193+
DK6Programmer.exe -V5 -s <COM port> -P 1000000 -w image_dir_1=00200000D9040101
194+
```
195+
196+
Using `dk6prog` from `SPSDK`:
197+
198+
```
199+
$ dk6prog -d DN038ZH3 write 0x168 [[00200000D9040101]] 8 PSECT
200+
201+
This is an experimental utility. Use with caution!
202+
203+
Writing memory [####################################] 100%
204+
Written 8 bytes to memory ID PSECT at address 0x168
205+
```
206+
207+
Here is the interpretation of the fields:
208+
209+
```
210+
00200000 -> start address 0x00002000
211+
D904 -> 0x4D9 pages of 512-bytes (= 620.5kB)
212+
01 -> bootable flag
213+
01 -> image type for the application
214+
```
215+
216+
- Matter application offset address should change to Using DK6Programmer
217+
utility from Windows:
218+
219+
```
220+
DK6Programmer.exe -V2 -s <COM_PORT> -P 1000000 -Y -p FLASH@0x2000="chip-k32w0x-contact-example.bin"
221+
```
222+
223+
Using `dk6prog` from `SPSDK`:
224+
225+
```
226+
$ dk6prog -d DN038ZH3 write 0x2000 ~/path/to/bin/chip-k32w0x-contact-example.bin
227+
228+
This is an experimental utility. Use with caution!
229+
230+
Writing memory [####################################] 100%
231+
Written 596450 bytes to memory ID 0 at address 0x2000
232+
```

0 commit comments

Comments
 (0)