Firmware updates via the serial port without loosing half the code space

SDK Environment: nRF Connect SDK v1.8.0
Target: Decawave DWM1001-DEV. This uses the nRF52832

My application uses more than half the flash size of the nRF52832.

Using mcuboot and smp it appears you need to have a working slot and a download slot for the firmware. I believe smp can not update the working slot. This means the firmware can only be a little less than half the size of the flash.

The only solution I have come up with so far, is to use mcuboot in serial recovery mode with CONFIG_SINGLE_APPLICATION_SLOT=y. The issue with this is that mcuboot in serial recovery mode only supports a subset of commands. mcumgr.exe" --conntype=serial --connstring=COM8 image list does not give the hash value, and so far I can't get version to display as anything other than "0.0.0.0".

Are there any better ways of implementing a serial boot loader for the nRF52832?

I have attached my current complete test project:

5165.hello-world.zip

Note the file "CMakeLists.txt" contains a file link with an absolute path that includes the ncs version. See my other post here about that issue.

Key created using

python \ncs\v1.8.0\nrf\scripts\bootloader\keygen.py --private -o test-key.pem

Built using

west build -b decawave_dwm1001_dev2 --pristine -d build2 /ncs/myapps/bootloader/hello-world -- -DBOARD_ROOT=/ncs/myapps/bootloader/hello-world

Programmed to the device using

west flash --runner nrfjprog --bin-file build/zephyr/app_update.bin -d build2

Firmware updates via the serial port using

mcumgr.exe --conntype=serial --connstring=COM8 image upload build2\zephyr\app_update.bin

Parents
  • Hello David!

    Unfortunately we don't provide any other alternative to what you mentioned.

    If you need support for more commands those needs to be ported from the generic mgmt subsystem, but that is not trivial since mcuboots port is mostly written from scratch. However, setting the application version should work, see here for info on how.

    It doesn't seem like you have set CONFIG_MCUBOOT_IMAGE_VERSION anywhere in your test project.

    Best regards,

    Elfving

  • It doesn't seem like you have set CONFIG_MCUBOOT_IMAGE_VERSION anywhere in your test project.

    I don't know why, but when I tried it, it did not seem to work in serial recovery mode. I just tried again adding CONFIG_MCUBOOT_IMAGE_VERSION="0.1.2+3" to the start of "prj.conf" and this time it worked. I have had a few things like this lately.

    For a test of the difference in the output of mcumgr image list when using smp vs serial recovery mode, I created the project "hello-world-ser-smp"

    hello-world-ser-smp.zip

    mcumgr --conntype=serial --connstring=COM8 image list
    Images:
     image=0 slot=0
        version: 0.1.2.4
        bootable: true
        flags: active confirmed
        hash: 18e97e07e825a0b8b2a1f2d999222377c7f63236eeaf5fb8b6fe276bfe19b78d
     image=0 slot=1
        version: 0.1.2.3
        bootable: true
        flags:
        hash: d3f4b4c572f84707bda19c2680cc23a716b0b6f51c2d21b6a94ab40d1d38bc0d
    Split status: N/A (0)

    Now after rebooting in serial recovery mode
    mcumgr --conntype=serial --connstring=COM8 image list
    Images:
     image=0 slot=0
        version: 0.1.2.4
        bootable: false
        flags:
        hash: Unavailable
     image=0 slot=1
        version: 0.1.2.3
        bootable: false
        flags:
        hash: Unavailable
    Split status: N/A (0)

    The version is displaying correctly in serial recovery mode, but not the flags or the hash.

Reply
  • It doesn't seem like you have set CONFIG_MCUBOOT_IMAGE_VERSION anywhere in your test project.

    I don't know why, but when I tried it, it did not seem to work in serial recovery mode. I just tried again adding CONFIG_MCUBOOT_IMAGE_VERSION="0.1.2+3" to the start of "prj.conf" and this time it worked. I have had a few things like this lately.

    For a test of the difference in the output of mcumgr image list when using smp vs serial recovery mode, I created the project "hello-world-ser-smp"

    hello-world-ser-smp.zip

    mcumgr --conntype=serial --connstring=COM8 image list
    Images:
     image=0 slot=0
        version: 0.1.2.4
        bootable: true
        flags: active confirmed
        hash: 18e97e07e825a0b8b2a1f2d999222377c7f63236eeaf5fb8b6fe276bfe19b78d
     image=0 slot=1
        version: 0.1.2.3
        bootable: true
        flags:
        hash: d3f4b4c572f84707bda19c2680cc23a716b0b6f51c2d21b6a94ab40d1d38bc0d
    Split status: N/A (0)

    Now after rebooting in serial recovery mode
    mcumgr --conntype=serial --connstring=COM8 image list
    Images:
     image=0 slot=0
        version: 0.1.2.4
        bootable: false
        flags:
        hash: Unavailable
     image=0 slot=1
        version: 0.1.2.3
        bootable: false
        flags:
        hash: Unavailable
    Split status: N/A (0)

    The version is displaying correctly in serial recovery mode, but not the flags or the hash.

Children
No Data
Related