-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Description
Zephyr HEAD: 0b00493
MCUboot HEAD: b97ec0fee8752f3fa376107dd053a7c02384bb8c
MCUmgr-cli HEAD: 073be80c4446a4c9c5102abdb8fadf1ae4a6a627
I've noticed regression in firmware update via mcumgr. After uploading the image one cannot list the available images.
Here are the steps to reproduce:
- In the MCUboot sources, build boot application
$ cd <MCUBOOT>/boot/zephyr && mkdir build && cd build$ cmake -DBOARD=nrf52840_pca10056 -GNinja ..$ ninja$ ninja flash
step_1.log
- Build smp_svr application form Zephyr sources
$ cd <ZEPHYR>/samples/subsys/mgmt/mcumgr/smp_svr && mkdir build && cd build$ cmake -DBOARD=nrf52840_pca10056 -GNinja ..$ ninja
step_2.log
- Sign and flash the smp_svr application
$ cd <MCUBOOT>$ ./scripts/imgtool.py sign -k root-rsa-2048.pem --align 8 -H 0x200 --version 1.0 -S 0x69000 ~/projects/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/build/zephyr/zephyr.bin zephyr_signed.bin, where-S 0x69000is slot size according toboards/arm/nrf52840_pca10056.dts$ arm-none-eabi-objcopy --change-address 0xc000 -I binary -O ihex zephyr_signed.bin zephyr_signed.hex, where0xc000is the address of slot0 according toboards/arm/nrf52840_pca10056.dts$ nrfjprog --program zephyr_signed.hex -f nrf52$ nrfjprog -f nrf52 -r
step_3.log
- Verify if the device is up and running smp_svr application (via mcumgr-cli)
$ ./mcumgr --conntype ble --connstring peer_name=Zephyr image list
step_4.log
step_4.btmon.log
Up and running, connection tested with nRFconnect on iPhone as well.
- Change the FW version
$ cd <MCUBOOT>$ ./scripts/imgtool.py sign -k root-rsa-2048.pem --align 8 -H 0x200 --version 2.0 -S 0x69000 ~/projects/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/build/zephyr/zephyr.bin zephyr_signed.bin
- Upload new FW
$ ./mcumgr --conntype ble --connstring peer_name=Zephyr image upload ~/projects/mcuboot/zephyr_signed.bin
step_6.log
step_6.btmon.log
- Verify if the device is up and running smp_svr application (via mcumgr-cli)
$ ./mcumgr --conntype ble --connstring peer_name=Zephyr image list
step_7.log
step_7.btmon.log
Got 'Error: NMP timeout' instead.
To get this things working
8. Revert below changes
9823852
cd1111e
9. Repeat steps 1-7
step_9.log
step_9.btmon.log
Images:
slot=0
version: 1.0.0
bootable: true
flags: active confirmed
hash: 52d625f7efe6028c8bc95d1b6ae3723248e81e4a17fb46a357e8aaf2cec787e1
slot=1
version: 2.0.0
bootable: true
flags:
hash: a20ec1215482e11c609f0a0fe4505f3979066ae0aa0d950fc871c0e19d688ef7
Split status: N/A (0)
Image is available in slot 1 as expected.