Skip to content

MCUboot firmware update issue #8636

@MariuszSkamra

Description

@MariuszSkamra

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:

  1. 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
  1. 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
  1. 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 0x69000 is slot size according to boards/arm/nrf52840_pca10056.dts
  • $ arm-none-eabi-objcopy --change-address 0xc000 -I binary -O ihex zephyr_signed.bin zephyr_signed.hex, where 0xc000 is the address of slot0 according to boards/arm/nrf52840_pca10056.dts
  • $ nrfjprog --program zephyr_signed.hex -f nrf52
  • $ nrfjprog -f nrf52 -r
    step_3.log
  1. Verify if the device is up and running smp_svr application (via mcumgr-cli)

Up and running, connection tested with nRFconnect on iPhone as well.

  1. 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
  1. Upload new FW
  • $ ./mcumgr --conntype ble --connstring peer_name=Zephyr image upload ~/projects/mcuboot/zephyr_signed.bin
    step_6.log
    step_6.btmon.log
  1. Verify if the device is up and running smp_svr application (via mcumgr-cli)

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.

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions