Mcuboot failing to load SMP SVR application on nRF5340 DK

Hi,

I'm trying to follow the MCUBoot + SMP SVR example on this page: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/README.html#smp-svr-sample

MCUBoot flashes just fine, but when I try to flash the signed binary of the SMP SVR application, MCUBoot only sees zeroes in the application header. I've added some debugging in MCUBoot so I can monitor why it's failing when trying to load the SMP SVR application:

*** Booting Zephyr OS build zephyr-v3.1.0-678-gd0a788669e15 ***
I: Starting bootloader
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
W: Failed reading image headers; Image=0
E: MAB boot_is_header_valid -- header magic (0x00000000) doesn't match (0x96f3b83d)
E: MAB boot_is_header_valid -- header magic (0x00000000) doesn't match (0x96f3b83d)
E: MAB boot_validate_slot -- boot_is_header_valid result = 0
E: MAB boot_validate_slot -- fih_not_eq result = 1
E: Image in the primary slot is not valid!
E: Unable to find bootable image

Can you advise on what could be the issue?

This is on an nRF5340 DK.

Parents Reply Children
  • Hi

    mablabs said:

    Will the first command that you posted:

    west build -p -b nrf5340dk_nrf5340_cpuapp

    build both MCUBoot and the SMP Server application into a single binary

    Yes, MCUBoot will be build as a child image to your application. See Bootloaders and Device Firmware Updates for a good explanation of bootloaders.

    When you program your board with the debugger, hex files are usually used.
    The binary files used for MCUBoot is for use for the DFU tools: typically sent over UART or Bluetooth Low Energy.
    For more information about our build system and which files are generated, see Build and configuration system.

    mablabs said:
    Don't I have to specify the actual project to build in the west invocation:

    west build -p -b <board_name> <path to project>?

    By default, `west build` will build for the current folder.(path is "./") Meaning that you only need the path if you build from another location.
    It is up to you where you want to build from really.

    Regards,
    Sigurd Hellesvik

Related