Documentation page for NRF5340 serial recovery

I am trying to implement serial recovery via USB on NRF 5340. I have come across this page that I used as a guide:

https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/nrf53/serial_recovery.html

I am either missing something or some of this page is wrong.

The second option it offers for network core recovery is documented as "Serial recovery for the network core in the one image pair mode, where sysbuild Kconfig option SB_CONFIG_MCUBOOT_UPDATEABLE_IMAGES is set to == 1." I think there is a problem with this.

SB_CONFIG_MCUBOOT_UPDATEABLE_IMAGES cannot be set (or at least I don't know how to) to 1 unless SB_CONFIG_MCUBOOT_MODE_SINGLE_APP is enabled. However, when SB_CONFIG_MCUBOOT_MODE_SINGLE_APP is enabled, and I apply the rest of the configuration described there, the update does not work. This seems to be because with SB_CONFIG_MCUBOOT_MODE_SINGLE_APP, NET_CORE_VIRTUAL_PRIMARY_SLOT is defined as -1, so the comparison in boot_serial_uploaded_hook() never recognizes the image as intended for the network core. As a consequence, with single slot, I can successfully upload the new network image, but it is never applied.

If SB_CONFIG_MCUBOOT_UPDATEABLE_IMAGES is set to 2 instead, then I also need to define the mcuboot_secondary_1 partition, something not mentioned on this page. In this setup, the upload is successful AND the new image is applied.

Is the documentation wrong or am I missing something? Ideally I would like to use a single slot configuration, but if it is not possible, then we'll work with what is.

  • Hello,

    Yes, unfortunately, it seems like the documentation needs to be updated in this area. Single slot configuration with netcore update support is not possible with the current implementation but you can try to have the secondary slots overlap as suggested in my answer here:  RE: nrf5340 bootloader . This will free up some flash. I will report this internally.

    Best regards,

    Vidar

  • Thanks! Is it planned to make single-slot workable on NRF5340 at some point?

    The overlap in partitions is an interesting solution for mcuboot_secondary_1. Ours (for serial recovery) has been to create a tiny dummy partition in RAM, right after mcuboot_primary_1:

    mcuboot_primary_1:
      address: 0x0
      size: 0x38000
      device: flash_ctrl
      region: ram_flash
    mcuboot_secondary_1: # should not be used at all
      address: 0x38000
      size: 0x1000
      device: flash_ctrl
      region: ram_flash

Related