Hi,
I tried the instructions from matter/examples/lighting-app/nxp/k32w/k32w0 at v1.2.0.1-tag-nxp · NXP/matter (github.com), and successfully built chip-k32w0x-light-example.bin.
I then flashed the DK6 board with command
C:\nxp\DK6Programmer> ./DK6Programmer.exe -s COM10 -p chip-k32w0x-light-example.bin
but the board UI LED does not correspond to the device UI as mentioned in the README file, and it looks like firmware is not running properly. Please advise.
Solved! Go to Solution.
Hi,
Thanks for your advice. It is working after I reset device to default state with SW2.
LED toggling command is working fine
root@imx8mmevk-matter:~# chip-tool onoff toggle 8888 1
Hello.
Can you please detail the configuration used for the build? Did you use the standard command?
gn gen out/debug --args="chip_with_OM15082=1 chip_with_ot_cli=0 is_debug=false chip_crypto=\"platform\" chip_with_se05x=0 chip_pw_tokenizer_logging=true"
If so, looking at the DK6Programmer command you used, this is writing the binary at address 0x0. This is not compatible with the standard built application binary. You also need to write the SSBL binary, as explained in the OTA chapter.
You can find the binary in the SDK downloaded with west command, in path %matter_root%/third_party/nxp/k32w0_sdk/repo/core/boards/k32w061dk6/wireless_examples/framework/ssbl/binary/ssbl_ext_flash_pdm_support.bin.
You need to write this binary first to the board with command:
DK6Programmer.exe -V2 -s <COM_PORT> -P 1000000 -Y -p FLASH@0x00="k32w061dk6_ssbl.bin"
Then you can write the application binary using the following command:
DK6Programmer.exe -V2 -s <COM_PORT> -P 1000000 -Y -p FLASH@0x4000="chip-k32w0x-light-example.bin"
The standard build command uses a Pigweed tokenizer to compress debug strings and save flash space so in order to validate that the application runs correctly, you need to call:
python3 ../../../../../examples/platform/nxp/k32w/k32w0/scripts/detokenizer.py serial -i /dev/ttyUSB0 -d out/debug/chip-k32w0x-light-example-database.bin -o device.txt
Please let me know if this works.
BR,
Mihai
Hello Mihai,
Thanks for suggestions to write SSBL binary.
I try again with following steps, according to ducument K32W0X1-MATTER-QSG.pdf (nxp.com)
PS C:\nxp\DK6Programmer> .\DK6Programmer.exe -V2 -s COM10 -P 1000000 -e flash
PS C:\nxp\DK6Programmer> .\DK6Programmer.exe -V2 -s COM10 -P 1000000 -Y -p FLASH@0x00="ssbl_ext_flash_pdm_support.bin"
PS C:\nxp\DK6Programmer> .\DK6Programmer.exe -V5 -s COM10 -P 1000000 -w image_dir_0=0000000010000000
PS C:\nxp\DK6Programmer> .\DK6Programmer.exe -V5 -s COM10 -P 1000000 -w image_dir_1=00400000C9040101
PS C:\nxp\DK6Programmer> .\DK6Programmer.exe -V2 -s COM10 -P 1000000 -Y -p FLASH@0x4000="chip-k32w0x-light-example.bin"
And I can see that the board is now having the right device UI with LED D2 flashing with Short Flash On (50ms on/950ms off)
Hello.
Glad to hear that it worked.
We recommend following the READMEs for the desired application from the Matter NXP Github as it contains all the updated information for building and running the examples. The Matter QSG is out of date, being based on Matter 1.0 release and we do not recommend using it at this point. We are planning to update the documentation to the latest version.
BR,
Mihai
I continue to setup the demo according to instructions at meta-nxp-connectivity/docs/guides/nxp_mpu_matter_demos.md at master · nxp-imx/meta-nxp-connectivity ...
i.MX8M MINI EVK is loaded with demo image from NXP named imx-matter_2023-q4_imx8mmevk-matter.zip
Two files were setup at home directory as below
root@imx8mmevk-matter:~# ls
setup-border-router.sh wifiap.conf
The file wifiap.conf is edited with the ssid and psk of my network using the tool 'wpa_passphrase'
Content of 'setup-border-router.sh'
#!/bin/sh
#
#
modprobe moal mod_para=nxp/wifi_mod_para.conf
wpa_supplicant -d -B -i mlan0 -c /home/root/wifiap.conf
udhcpc -i mlan0
echo "nameserver 8.8.8.8" > /etc/resolv.conf
service otbr_fwcfg start
modprobe btnxpuart
hciconfig hci0 up
#thread
otbr-agent -I wpan0 -B mlan0 'spinel+hdlc+uart:///dev/ttyUSB0?uart-baudrate=1000
000' &
iptables -A FORWARD -i mlan0 -o wpan0 -j ACCEPT
iptables -A FORWARD -i wpan0 -o mlan0 -j ACCEPT
otbr-web &
#form openthread network
ot-ctl dataset init new
ot-ctl dataset commit active
ot-ctl ifconfig up
ot-ctl thread start
Execute the script above with the following output:
[ 403.593466] mlan: loading out-of-tree module taints kernel. Take note of the errors 1. connect session failed: No such file or directory 2. OpenThread daemon is not running
|
Get Thread network credentials:
root@imx8mmevk-matter:~# ot-ctl dataset active -x
0e08000000000001000035060004001fffe00708fd457e7b5b4fa1030c0402a0f7f8051000112233445566778899aabbccddeeff030e4f70656e54687265616444656d6f0410445f2b5ca6f2a93a55ce570a70efeecb000300000f0208111111112222222201021234
Done
commissioning
$ chip-tool pairing ble-thread 8888 hex:0e08000000000001000035060004001fffe00708fd457e7b5b4fa1030c0402a0f7f8051000112233445566778899aabbccddeeff030e4f70656e54687265616444656d6f0410445f2b5ca6f2a93a55ce570a70efeecb000300000f0208111111112222222201021234 20202021 3840
the output is:
[1716487179.371187][778:778] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_tool_kvs |
there is error Run command failure ...Internal error Seems like it is able to discover the ble broadcasted and attempted to connect but something was wrong. And i can see that the LED D2 state on DK6 is corresponding to "Short Flash Off (950ms on/50ms off) — The device is full provisioned, but does not yet have full network (Thread) or service connectivity"
Please advise what is wrong here. Thanks |
Hello.
Just to confirm, you are running as OTBR an NXP i.MX8 Mini EVK + a K32W0x1 USB dongle/DK6 board as Radio CoProcessor (RCP)? I can see a UART communication in the otbr logs.
A first thought is that the commands are issued too fast and recommendation would be to introduce some sleep calls between some commands. For example:
#!/bin/sh
#
#
modprobe moal mod_para=nxp/wifi_mod_para.conf
wpa_supplicant -d -B -i mlan0 -c /home/root/wifiap.conf
sleep 5
udhcpc -i mlan0
sleep 5
echo "nameserver 8.8.8.8" > /etc/resolv.conf
service otbr_fwcfg start
modprobe btnxpuart
hciconfig hci0 up
#thread
otbr-agent -I wpan0 -B mlan0 'spinel+hdlc+uart:///dev/ttyUSB0?uart-baudrate=1000
000' &
iptables -A FORWARD -i mlan0 -o wpan0 -j ACCEPT
iptables -A FORWARD -i wpan0 -o mlan0 -j ACCEPT
otbr-web &
sleep 2
#form openthread network
ot-ctl dataset init new
sleep 1
ot-ctl dataset commit active
sleep 1
ot-ctl ifconfig up
sleep 1
ot-ctl thread start
Can you please try and provide feedback on this change?
BR,
Mihai
Hi,
Yes, the setup is running as OTBR on NXP i.MX8 Mini EVK + a K32W0x1 USB dongle as Radio CoProcessor (RCP). I modified the setup script as per advised:
#!/bin/sh
#
#
modprobe moal mod_para=nxp/wifi_mod_para.conf
wpa_supplicant -d -B -i mlan0 -c /home/root/wifiap.conf
sleep 5
udhcpc -i mlan0
sleep 5
echo "nameserver 8.8.8.8" > /etc/resolv.conf
service otbr_fwcfg start
modprobe btnxpuart
hciconfig hci0 up
#thread
otbr-agent -I wpan0 -B mlan0 'spinel+hdlc+uart:///dev/ttyUSB0?uart-baudrate=1000000' &
iptables -A FORWARD -i mlan0 -o wpan0 -j ACCEPT
iptables -A FORWARD -i wpan0 -o mlan0 -j ACCEPT
otbr-web &
sleep 2
#form openthread network
ot-ctl dataset init new
sleep 1
ot-ctl dataset commit active
sleep 1
ot-ctl ifconfig up
sleep 1
ot-ctl thread start
And continue to run the setup process with the attached putty-1.log.
It still show the previously mentioned error, and the K32W End node's LED state D2 is
Subsequently i tried to form thread network with OTBR Web interface
and I run the following command again:
root@imx8mmevk-matter:~# ot-ctl dataset active -x
0e08000000000001000035060004001fffe00708fd373fbfaeb7e88f0c0402a0f7f8051000112233445566778899aabbccddeeff030e4f70656e54687265616444656d6f0410445f2b5ca6f2a93a55ce570a70efeecb000300000f0208111111112222222201021234
Done
root@imx8mmevk-matter:~# chip-tool pairing ble-thread 8888 hex:0e08000000000001000035060004001fffe00708fd373fbfaeb7e88f0c0402a0f7f8051000112233445566778899aabbccddeeff030e4f70656e54687265616444656d6f0410445f2b5ca6f2a93a55ce570a70efeecb000300000f0208111111112222222201021234 20202021 3840
And the output log is attached at putty-2.log
This time round the K32W End node's LED state D2 is
Can you also confirm the used binary for the RCP on the K32W0x1 USB dongle? It should be the one from the Matter SDK's third_party/nxp/k32w0_sdk_repo/core/tools/wireless/ot-rcp/ot-rcp-uart-no-fc-usb.bin
Also, a factory reset from the lighting app on the K32W061DK and on the i.MX8 should be done:
Button SW2 can be used to reset the device to a default state. A short Press Button SW2 initiates a factory reset. After an initial period of 3 seconds, LED2 D2 and D3 will flash in unison to signal the pending reset. After 6 seconds will cause the device to reset its persistent configuration and initiate a reboot. The reset action can be cancelled by press SW2 button at any point before the 6 second limit.
sudo rm -rf /tmp/chip*
We are trying to replicate on our side and will come back with feedback.
BR,
Mihai
Hello.
I confirm that we are not seeing the issue on our side, using i.MX8 Mini with the imx-matter_2023-q4_imx8mmevk-matter image and the k32w0 USB RCP with ot-rcp-uart-no-fc-usb firmware.
Do you have any development on your side?
BR,
Mihai
Hi
My full configurations are following
i.MX8M MINI EVK Image | imx-matter_2023-q4_imx8mmevk-matter.zip |
USB Thread RCP Hardware | OM15080-K32W |
USB Thread RCP Firmware | ~/nxp-mcu-sdk-2.6.14/tools/wireless/ot-rcp$ ls ot-rcp-uart-no-fc-usb.axf ot-rcp-uart-no-fc-usb.bin |
Lighting APP Firmware Build | user01@user01-VirtualBox:~/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=\"platform\" chip_with_se05x=0 chip_pw_tokenizer_logging=true" device: K32W061 board: k32w061dk6 ntag: 0 increased TX power: 0 FRO32k: 0 low power: 0 OTA default firmware processor: 1 OTA default factory data processor: 0 PDM Encryption: 1 Antenna Diversity enabled: 0 ECC crypto lib: NXP-Ultrafast-P256 chip_with_sdk_package: 1 Done. Made 3667 targets from 305 files in 552ms |
Can you identify any differences between my setup and your setup?
Since there are multiple versions of demo setup documentations on Github & NXP website, maybe you can share the exact steps that you did so that i can do the same?
Hi,
Thanks for your advice. It is working after I reset device to default state with SW2.
LED toggling command is working fine
root@imx8mmevk-matter:~# chip-tool onoff toggle 8888 1
Glad to hear. If you are satisfied with the results, you can mark the relevant post as resolution.
Have a nice day!
Mihai