This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Commit Nordic Connect SDK breaks the boot of my application

Hi,

I am developing an Openthread application using Nordic Connect SDK for the nrf52840dongle. I updated my nrf SDK to bd075cc09. Since then, my application won't boot anymore. Commit with hash 141d711c910cba10ec1ccf204af8825ebb6d4890, seems to have caused the issue. I accidently had CONFIG_BOARD_HAS_NRF5_BOOTLOADER enabled together with  CONFIG_BOOTLOADER_MCUBOOT. When I build with CONFIG_BOARD_HAS_NRF5_BOOTLOADER not enabled, my application boots without any problems. Will this commit have influence on devices that are already in the field which had CONFIG_BOOTLOADER_MCUBOOT and CONFIG_BOARD_HAS_NRF5_BOOTLOADER  enabled simultaneously?

Thank you

  • Sorry for the delay on this, I'm currently looking into it

    Best regards,

    Simon

  • I have some questions:

    • How do you program the dongle? Through SWD using an external debugger, or through the nRF Connect Programmer app and USB DFU using the onboard nRF5 SDK bootloader?
    • Are you using MCUboot to update the dongle?

    When you enable MCUboot in NCS, the partition manager is used to place the partitions (not the device tree). Before commit 141d711c910 it would place the mcuboot at memory location 0x00 and not allocate space for the MBR (which is needed when programming the dongle through the programmer app and USB DFU, as explained in the nRF52840 Dongle Tutorial). The partitions would look something like this:

      flash_primary (0x100000 - 1024kB): 
    +-------------------------------------------------+
    | 0x0: mcuboot (0xc000 - 48kB)                    |
    +---0xc000: mcuboot_primary (0x7a000 - 488kB)-----+
    | 0xc000: mcuboot_pad (0x200 - 512B)              |
    +---0xc200: mcuboot_primary_app (0x79e00 - 487kB)-+
    | 0xc200: app (0x79e00 - 487kB)                   |
    +-------------------------------------------------+
    | 0x86000: mcuboot_secondary (0x7a000 - 488kB)    |
    +-------------------------------------------------+

    However, after commit 141d711c91, the partition manager will allocate 4kB of flash in the start for the nRF52840 dongle, to leave space for the mbr, and the partitions will look like this:

    flash_primary (0x100000 - 1024kB): 
    +-------------------------------------------------+
    | 0x0: nrf5_mbr (0x1000 - 4kB)                    |
    | 0x1000: mcuboot (0xc000 - 48kB)                 |
    +---0xd000: mcuboot_primary (0x79000 - 484kB)-----+
    | 0xd000: mcuboot_pad (0x200 - 512B)              |
    +---0xd200: mcuboot_primary_app (0x78e00 - 483kB)-+
    | 0xd200: app (0x78e00 - 483kB)                   |
    +-------------------------------------------------+
    | 0x86000: mcuboot_secondary (0x79000 - 484kB)    |
    | 0xff000: EMPTY_0 (0x1000 - 4kB)                 |
    +-------------------------------------------------+

    I assume it isn't working for you after commit 141d711c91 is because nothing is located at the start of flash, and nothing will ever boot, since it won't find any vector tables at 0x00 as explained in https://devzone.nordicsemi.com/f/nordic-q-a/65819/updating-start-address-to-nrf52840-dk-via-code/270454#270454.

    Best regards,

    Simon

Related