This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

First and second stage bootloader issue with nRF Connect SDK

Hi all,

I working with NCS v1.7.1 on a custom board using nRF52840 and I am trying to enable a 2-stage bootloader setup using NSIB as the first stage immutable bootloader and mcuboot as the second stage upgradeable bootloader, ie I have enabled the following configuration options:

CONFIG_SECURE_BOOT=y

CONFIG_BOOTLOADER_MCUBOOT=y

I program the board with the resulting merged.hex file and I see NSIB starting up but cannot find mcuboot in any of the two slots. This is the console output

The two slots of NSIB are at addresses 0x9000 and 0x16000. However, from what I see in the nRF Programmer app mcuboot is loaded at address 0x9200, ie at an offset equal to the padding size. Does that mean that no image info header is written at the beginning of the slog and that is why NSIB cannot find mcuboot?

Am I missing something in the build or flashing process?

Thank you

Parents
  • Hi,

     

    I added these configurations:

    CONFIG_SECURE_BOOT=y

    CONFIG_BOOTLOADER_MCUBOOT=y

    To a generic project, and it booted just fine at my end:

    *** Booting Zephyr OS build v2.6.99-ncs1-1  ***
    Attempting to boot slot 0.
    Attempting to boot from address 0x9200.
    Verifying signature against key 0.
    Hash: 0xc2...86
    Firmware signature verified.
    Firmware version 1
    Setting monotonic counter (version: 1, slot: 0)
    *** Booting Zephyr OS build v2.6.99-ncs1-1  ***
    I: Starting bootloader
    I: Primary image: magic=bad, swap_type=0x3, copy_done=0x2, image_ok=0x2
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    I: Boot source: none
    I: Swap type: none
    I: Primary image: magic=bad, swap_type=0x1, copy_done=0x2, image_ok=0x2
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    I: Boot source: none
    I: Swap type: none
    I: Bootloader chainload address offset: 0x23000
    �*** Booting Zephyr OS build v2.6.99-ncs1-1  ***
    Hello World! nrf52840dk_nrf52840
    

     

    Could you try to delete your build folder and re-generate the project?

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    I added these configurations:

    CONFIG_SECURE_BOOT=y

    CONFIG_BOOTLOADER_MCUBOOT=y

    To a generic project, and it booted just fine at my end:

    *** Booting Zephyr OS build v2.6.99-ncs1-1  ***
    Attempting to boot slot 0.
    Attempting to boot from address 0x9200.
    Verifying signature against key 0.
    Hash: 0xc2...86
    Firmware signature verified.
    Firmware version 1
    Setting monotonic counter (version: 1, slot: 0)
    *** Booting Zephyr OS build v2.6.99-ncs1-1  ***
    I: Starting bootloader
    I: Primary image: magic=bad, swap_type=0x3, copy_done=0x2, image_ok=0x2
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    I: Boot source: none
    I: Swap type: none
    I: Primary image: magic=bad, swap_type=0x1, copy_done=0x2, image_ok=0x2
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    I: Boot source: none
    I: Swap type: none
    I: Bootloader chainload address offset: 0x23000
    �*** Booting Zephyr OS build v2.6.99-ncs1-1  ***
    Hello World! nrf52840dk_nrf52840
    

     

    Could you try to delete your build folder and re-generate the project?

     

    Kind regards,

    Håkon

Children
No Data
Related