Secure bootloader chain + two-stage upgradable bootloader MCUBOOT

I am working with nRF connect SDK with nRF5340DK. I am compiling code using nRF connect (ncs-1.8.0) for VS code with nrf5340dk_nrf5340_cpuapp board.

prj.conf as below,

CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUMGR=y
CONFIG_SECURE_BOOT=y
Using this I can enabling two-stage bootloader, here are the log,
 
*** Booting Zephyr OS build v2.7.0-ncs1 ***

Attempting to boot slot 0.

Attempting to boot from address 0x8200.

Verifying signature against key 0.

Hash: 0x12...93

Firmware signature verified.

Firmware version 1

Booting (0x8200).

*** Booting Zephyr OS build v2.7.0-ncs1 ***

I: Starting bootloader
I: Primary image: magic=good, swap_type=0x3, copy_done=0x1, image_ok=0x1
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=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Bootloader chainload address offset: 0x28000
I: Jumping to the first image slot
*** Booting Zephyr OS build v2.7.0-ncs1 ***
I can firmware upgrade over-the-air (FOTA) for application using app_update.bin file.
Question:
1) How can I upgrade the second stage bootloader(MCUBoot bootloader)?
2) Which bin file to upload for upgrade the second stage bootloader?
Parents Reply
  • Hi

    Here are how I do DFU for the Machine learning sample:

    west build -p -b nrf5340dk_nrf5340_cpuapp
    west flash --erase

    Then I make edits to src/main and zephyr/samples/bluetooth/hci_rpmsg/src/main.c

    Reset the nRF5340DK when holding Button1 to enter Serial Recovery Mode.

    west build -p -b nrf5340dk_nrf5340_cpuapp
    mcumgr conn add acm1 type="serial" connstring="dev=/dev/ttyACM1,baud=115200,mtu=512"
    mcumgr -c acm1 image list
    mcumgr -c acm1 image upload -n 3 build/zephyr/net_core_app_update.bin
    #wait 2 minutes to allow Network Core to copy image.
    mcumgr -c acm1 image upload build/zephyr/app_update.bin
    nrfjprog --reset
    

    After this, I can see the new prints I added to the files in the terminal.

    Is this what you were looking for?

    Regards,
    Sigurd Hellesvik

Children
Related