Skip to content

Commit 6ff45cf

Browse files
[K32W0] Add platform changes and features (#22896) (#22984)
* [K32W0] Add platform changes and features * Add SVE2 fixes and other changes and features * Add support for custom certificate policy. * Certificate declaration: set certificate_type to 1 * Add new demo certificates * Add demo certificates allowing testing with two different DUTs * Add custom lighting app ZAP file - e.g.: removed generic and not needed clusters like the ones required for Ethernet/WiFi; removed the optional clusters for an On/Off Device Type; * Add ksdk_mbedlts.c such that we redirect all the AES calls through SecLib.c * Add TestEventTrigger Support * Add functionality for ResetWatermarks() * Add callback for PDM logs * Fix NotifyUpdateApplied - message that is sent when booting for the first time with an OTA image was not being send due to a bug in the PDM read function: ReadConfigValue(...); * Add delay when rebooting after OTA finishes * Improve OTA mechanism * Remove third parameter of ReadConfigValue() and use a TValue& parameter which can be used for extracting the value length * Consume faster the RX buffer * RX buffer should be processed with high priority because: * 15.4 packets are consumed on Thread task; * Thread task has a higher priority than the Matter one (3 > 2) * Fix Low Power * fix 15.4 warm-up time: before this commit calibration time also included the time required for attaching to the Thread network This led to a large warm-up value that blocked some 15.4 operations Fix this by including in the warm-up time only the 15.4 radio initialization time * fix the warm-up initial value to avoid any conflicts * fix possible overflow in reading timestamp values * Make sure that all the logs are disabled when an application is compiled with low-power support; logging can interference with LP timings and break functionality; * Fix time support for Matter * using FreeRTOS timers (based on FreeRTOS tickets) is inaccurate and leads to time drifting * use OT Timers API (Wtimer-based) for getting us/ms timestamps * Fix ExtractPubkeyFromX509Cert in CHIPCryptoPALTinyCrypt.cpp * Fix BLE advertising interval + issue warning if the peer doesn't support 2Mbps * Fix Diagnostic Data Provider * Fix OnOff attribute persistence over hw reset * Fix compilation issue for lock-app * Disable by default on lighting-app BLE Set Phy Req to 2M to be extra cautious during interops * Update readme files Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com> Signed-off-by: Marius Tache <marius.tache@nxp.com> Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com> * Fix gn includes, spelling, wordlist Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com> * Update ot-nxp submodule Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com> * Fix gn includes, exclude certs from restyle, fix messaging readme Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com> * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Restyled by prettier-markdown * Restyled by shellharden * Restyled by shfmt * Restyled by autopep8 * Fix low-power build Signed-off-by: Marius Tache <marius.tache@nxp.com> Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com> * Restyled by clang-format * Fix SecLib compile issue Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com> * Restyled by clang-format * Update worflows K32W0 examples yaml Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com> * Update docker version, expected gn gen Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com> * Hotfix nxp shell build Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com> Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com> Signed-off-by: Marius Tache <marius.tache@nxp.com> Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com> Co-authored-by: Restyled.io <commits@restyled.io> Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com> Signed-off-by: Marius Tache <marius.tache@nxp.com> Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com> Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 6c34fa8 commit 6ff45cf

File tree

115 files changed

+20067
-1553
lines changed

Some content is hidden

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

115 files changed

+20067
-1553
lines changed

.github/.wordlist.txt

+7-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ accessor
2020
AccountLogin
2121
acdbc
2222
ack
23-
ACK
2423
ACKed
2524
ACL
2625
ACLs
@@ -156,7 +155,6 @@ bootable
156155
Bootloader
157156
BorderRouterAP
158157
bouffalolab
159-
Bouffalolab
160158
BRD
161159
breakpoint
162160
bredr
@@ -332,6 +330,7 @@ cxx
332330
CY
333331
CYW
334332
DAC
333+
DACs
335334
dadbdcdddedf
336335
DAP
337336
DAPLINK
@@ -449,6 +448,7 @@ dryrun
449448
DS
450449
duplicative
451450
DUT
451+
DUTS
452452
DV
453453
DVK
454454
dynload
@@ -596,9 +596,9 @@ GPL
596596
GPLv
597597
Gradle
598598
gradlew
599+
Groupcast
599600
GroupId
600601
GroupKeyManagement
601-
Groupcast
602602
groupKeySecurityPolicy
603603
groupKeySetID
604604
groupsettings
@@ -652,7 +652,6 @@ ignoreQueryImage
652652
ihex
653653
IlluminanceMeasurement
654654
IM
655-
IsInitiator
656655
imager
657656
imagetool
658657
imageUri
@@ -990,6 +989,7 @@ PAAs
990989
PacketBuffer
991990
PAI
992991
PairDevice
992+
PAIs
993993
PAKE
994994
palletsprojects
995995
pankore
@@ -1376,13 +1376,14 @@ uint
13761376
ULA
13771377
UNBLUR
13781378
uncommissioned
1379+
Unencrypted
13791380
unfocus
13801381
Unicast
13811382
UniFlash
13821383
UnitLocalization
1383-
Unencrypted
13841384
unpair
13851385
unprovisioned
1386+
Unsecure
13861387
untrusted
13871388
updateAvailable
13881389
updateNotAvailable
@@ -1400,7 +1401,6 @@ userConsentState
14001401
userguide
14011402
USERINTERFACE
14021403
UserLabel
1403-
Unsecure
14041404
usermod
14051405
usr
14061406
UTF
@@ -1419,6 +1419,7 @@ ver
14191419
Verifier
14201420
Verifiers
14211421
VID
1422+
vids
14221423
virtualenv
14231424
visualstudio
14241425
vlatest

.github/workflows/examples-k32w.yaml

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

3636
container:
37-
image: connectedhomeip/chip-build-k32w:0.5.99
37+
image: connectedhomeip/chip-build-k32w:0.6.02
3838
volumes:
3939
- "/tmp/bloat_reports:/tmp/bloat_reports"
4040
steps:

.restyled.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ exclude:
7474
- "examples/chef/zzz_generated/**/*"
7575
- "src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm" # https://github.com/project-chip/connectedhomeip/issues/20236
7676
- "src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h" # https://github.com/project-chip/connectedhomeip/issues/20236
77+
- "examples/platform/nxp/k32w/k32w0/scripts/demo_generated_certs/**/*"
7778

7879

7980
changed_paths:

examples/lighting-app/nxp/k32w/k32w0/BUILD.gn

+5-11
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,13 @@ k32w0_executable("light_app") {
7979
"main/main.cpp",
8080
]
8181

82+
public = [ "${chip_root}/src/platform/nxp/k32w/k32w0/DefaultTestEventTriggerDelegate.h" ]
83+
8284
deps = [
8385
":sdk",
8486
"${chip_root}/examples/common/QRCode",
85-
"${chip_root}/examples/lighting-app/lighting-common/",
87+
"${chip_root}/examples/lighting-app/nxp/zap/",
88+
"${chip_root}/examples/providers:device_info_provider",
8689
"${chip_root}/src/lib",
8790
"${chip_root}/third_party/mbedtls:mbedtls",
8891
"${k32w0_platform_dir}/app/support:freertos_mbedtls_utils",
@@ -113,16 +116,7 @@ k32w0_executable("light_app") {
113116
"-Wl,--defsym",
114117
"-Wl,__app_load_address__=0x4000",
115118
"-Wl,--defsym",
116-
"-Wl,__app_stated_size__=0x99A00",
117-
]
118-
}
119-
120-
if (chip_enable_ota_requestor) {
121-
ldflags += [
122-
"-Wl,--defsym",
123-
"-Wl,__app_load_address__=0x4000",
124-
"-Wl,--defsym",
125-
"-Wl,__app_stated_size__=0x99A00",
119+
"-Wl,__app_stated_size__=0x99200",
126120
]
127121
}
128122

examples/lighting-app/nxp/k32w/k32w0/README.md

+35-22
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ network.
2222
- [Bluetooth LE Rendezvous](#bluetooth-le-rendezvous)
2323
- [Device UI](#device-ui)
2424
- [Building](#building)
25+
- [Known issues](#building-issues)
26+
- [Manufacturing data](#manufacturing)
2527
- [Flashing and debugging](#flashdebug)
2628
- [Pigweed Tokenizer](#tokenizer)
2729
- [Detokenizer script](#detokenizer)
@@ -193,18 +195,15 @@ effects:
193195
In order to build the Project CHIP example, we recommend using a Linux
194196
distribution (the demo-application was compiled on Ubuntu 20.04).
195197

196-
- Download [K32W0 SDK 2.6.6 for Project CHIP](https://mcuxpresso.nxp.com/).
197-
Creating an nxp.com account is required before being able to download the
198-
SDK. Once the account is created, login and follow the steps for downloading
199-
SDK_2_6_6_K32W061DK6 (required for K32W061 flavor). The SDK Builder UI
200-
selection should be similar with the one from the image below.
201-
![MCUXpresso SDK Download](../../../../platform/nxp/k32w/k32w0/doc/images/mcux-sdk-download.JPG)
198+
- Download
199+
[K32W0 SDK 2.6.7](https://cache.nxp.com/lgfiles/bsps/SDK_2_6_7_K32W061DK6.zip).
202200

203201
- Start building the application either with Secure Element or without
204202
- without Secure Element
205203

206204
```
207-
user@ubuntu:~/Desktop/git/connectedhomeip$ export NXP_K32W0_SDK_ROOT=/home/user/Desktop/SDK_2_6_6_K32W061DK6/
205+
user@ubuntu:~/Desktop/git/connectedhomeip$ export NXP_K32W0_SDK_ROOT=/home/user/Desktop/SDK_2_6_7_K32W061DK6/
206+
user@ubuntu:~/Desktop/git/connectedhomeip$ ./third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh
208207
user@ubuntu:~/Desktop/git/connectedhomeip$ source ./scripts/activate.sh
209208
user@ubuntu:~/Desktop/git/connectedhomeip$ cd examples/lighting-app/nxp/k32w/k32w0
210209
user@ubuntu:~/Desktop/git/connectedhomeip/examples/lighting-app/nxp/k32w/k32w0$ gn gen out/debug --args="k32w0_sdk_root=\"${NXP_K32W0_SDK_ROOT}\" chip_with_OM15082=1 chip_with_ot_cli=0 is_debug=false chip_crypto=\"tinycrypt\" chip_with_se05x=0 chip_pw_tokenizer_logging=true mbedtls_repo=\"//third_party/connectedhomeip/third_party/nxp/libs/mbedtls\""
@@ -246,6 +245,20 @@ pycryptodome 3.9.8
246245

247246
The resulting output file can be found in out/debug/chip-k32w0x-light-example.
248247

248+
<a name="building-issues"></a>
249+
250+
## Known issues
251+
252+
- When using Secure element and cross-compiling on Linux, log messages from
253+
the Plug&Trust middleware stack may not echo to the console.
254+
255+
<a name="manufacturing"></a>
256+
257+
## Manufacturing data
258+
259+
See
260+
[Guide for writing manufacturing data on NXP devices](../../../../platform/nxp/doc/manufacturing_flow.md).
261+
249262
<a name="flashdebug"></a>
250263

251264
## Flashing and debugging
@@ -414,14 +427,14 @@ Here is the interpretation of the fields:
414427
Second, image directory 1 must be written:
415428

416429
```
417-
DK6Programmer.exe -V5 -s <COM port> -P 1000000 -w image_dir_1=00400000CD040101
430+
DK6Programmer.exe -V5 -s <COM port> -P 1000000 -w image_dir_1=00400000C9040101
418431
```
419432

420433
Here is the interpretation of the fields:
421434

422435
```
423436
00400000 -> start address 0x00004000
424-
CD04 -> 0x4CD pages of 512-bytes (= 614,5kB)
437+
CD04 -> 0x4C9 pages of 512-bytes (= 612,5kB)
425438
01 -> bootable flag
426439
01 -> image type for the application
427440
```
@@ -482,42 +495,42 @@ used for connecting the RPis to WiFi.
482495
Build the Linux OTA provider application:
483496

484497
```
485-
doru@computer1:~/connectedhomeip$ : ./scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/ota-provider-app chip_config_network_layer_ble=false
498+
user@computer1:~/connectedhomeip$ : ./scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/ota-provider-app chip_config_network_layer_ble=false
486499
```
487500

488501
Build OTA image and start the OTA Provider Application:
489502

490503
```
491-
doru@computer1:~/connectedhomeip$ : ./src/app/ota_image_tool.py create -v 0xDEAD -p 0xBEEF -vn 1 -vs "1.0" -da sha256 chip-k32w0x-light-example.bin chip-k32w0x-light-example.ota
492-
doru@computer1:~/connectedhomeip$ : rm -rf /tmp/chip_*
493-
doru@computer1:~/connectedhomeip$ : ./out/ota-provider-app/chip-ota-provider-app -f chip-k32w0x-light-example.ota
504+
user@computer1:~/connectedhomeip$ : ./src/app/ota_image_tool.py create -v 0xDEAD -p 0xBEEF -vn 1 -vs "1.0" -da sha256 chip-k32w0x-light-example.bin chip-k32w0x-light-example.ota
505+
user@computer1:~/connectedhomeip$ : rm -rf /tmp/chip_*
506+
user@computer1:~/connectedhomeip$ : ./out/ota-provider-app/chip-ota-provider-app -f chip-k32w0x-light-example.ota
494507
```
495508

496509
Build Linux chip-tool:
497510

498511
```
499-
doru@computer1:~/connectedhomeip$ : ./scripts/examples/gn_build_example.sh examples/chip-tool out/chip-tool-app
512+
user@computer1:~/connectedhomeip$ : ./scripts/examples/gn_build_example.sh examples/chip-tool out/chip-tool-app
500513
```
501514

502515
Provision the OTA provider application and assign node id _1_. Also, grant ACL
503516
entries to allow OTA requestors:
504517

505518
```
506-
doru@computer1:~/connectedhomeip$ : rm -rf /tmp/chip_*
507-
doru@computer1:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool pairing onnetwork 1 20202021
508-
doru@computer1:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": null}]' 1 0
519+
user@computer1:~/connectedhomeip$ : rm -rf /tmp/chip_*
520+
user@computer1:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool pairing onnetwork 1 20202021
521+
user@computer1:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": null}]' 1 0
509522
```
510523

511524
Provision the device and assign node id _2_:
512525

513526
```
514-
doru@computer1:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool pairing ble-thread 2 hex:<operationalDataset> 20202021 3840
527+
user@computer1:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool pairing ble-thread 2 hex:<operationalDataset> 20202021 3840
515528
```
516529

517530
Start the OTA process:
518531

519532
```
520-
doru@computer1:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 2 0
533+
user@computer1:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 2 0
521534
```
522535

523536
<a name="otaissues"></a>
@@ -537,16 +550,16 @@ doru@computer1:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool otasoftwareupd
537550
command:
538551

539552
```
540-
doru@computer1:~/connectedhomeip$ : sudo docker kill $container_id
553+
user@computer1:~/connectedhomeip$ : sudo docker kill $container_id
541554
```
542555

543556
- In order to avoid MDNS issues, only one interface should be active at one
544557
time. E.g.: if WiFi is used then disable the Ethernet interface and also
545558
disable multicast on that interface:
546559

547560
```
548-
doru@computer1:~/connectedhomeip$ sudo ip link set dev eth0 down
549-
doru@computer1:~/connectedhomeip$ sudo ifconfig eth0 -multicast
561+
user@computer1:~/connectedhomeip$ sudo ip link set dev eth0 down
562+
user@computer1:~/connectedhomeip$ sudo ifconfig eth0 -multicast
550563
```
551564

552565
- If OTBR Docker image is used, then the "-B" parameter should point to the

0 commit comments

Comments
 (0)