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

Zephyr with MCUboot and Simple Management Protocol (SMP)

Dear community,

i'm working on an application for the nRF52832. I would like to use MCUboot as Bootloader and Zephyr for the main application. The current situation is that i'm using the west tool for buildung and flashing the software. Not sure if it's my fault but the west tool has issues with debugging (that's what im doing with Segger Studio for NRF now). Mainly im working with the examples from ncs (Zephyr + NRF) and with the contributions of the devzone community to figure how things are working - many thanks!

But i'm stuck now: 

  • When i'm uploading the application (currently it is the smp_svr app) and the bootloader the microcontroller can be reset by mcumgr and the 'echo' command works also fine. The upload does not work. Does the application needs to be signed?
  • When i'm uploading only the bootloader it's not possible to communicate with mcumgr. Do i need to setup the smp features for the MCUboot, too?

In both cases i'm using the serial line.

Many thanks in advance!

Kind regards,

Michael

Parents
  • Hello Carl,

    thanks for your reply. Do i need MCUBoot with mcumgr? What's the common way to use MCUBoot with Zephyr?

    I have built the smp_svr (zephyr\samples\subsys\mgmt\mcumgr\smp_svr) example within the ncs folder and after building there weren't no signed files in the <project_folder>/<build_folder>/zephyr/.

    # Enable mcumgr.
    CONFIG_MCUMGR=y
    
    # Some command handlers require a large stack.
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    # Ensure an MCUboot-compatible binary is generated.
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_ROM_START_OFFSET=0xc000 <-- That's the only flag i add, because imgtool was complaining about the offset
    
    # Enable flash operations.
    CONFIG_FLASH=y
    
    # Required by the `taskstat` command.
    CONFIG_THREAD_MONITOR=y
    
    # Enable statistics and statistic names.
    CONFIG_STATS=y
    CONFIG_STATS_NAMES=y
    
    # Enable most core commands.
    CONFIG_MCUMGR_CMD_IMG_MGMT=y
    CONFIG_MCUMGR_CMD_OS_MGMT=y
    CONFIG_MCUMGR_CMD_STAT_MGMT=y
    
    # Enable logging
    CONFIG_LOG=y
    CONFIG_MCUBOOT_UTIL_LOG_LEVEL_WRN=y

    The smp_svr software was built with the command  west build -b nrf52dk_nrf52832. The MCUboot was built with the same command without any changes in the prj.conf.

    Kind regards,

    Michael

  • Hi again!

    You do not need MCUBoot with mcumgr. As explained in the Zephyr DFU documentation MCUBoot should be flashed initially, and then the application image can be upgraded using mcumgr. It's the DFU subsystem in the that interacts with MCUBoot, not mcumgr directly. 

    Are you using Zephyr standalone or the nRF Connect SDK? Below is some of the images that should be present in the zephyr folder after building with NCS:

    app_signed.hex
    app_test_update.hex
    app_to_sign.bin
    app_update.bin

    I'm not sure if Zephyr standalone does this signing process. If not you must sign the image as described in the SMP Server documentation. Make sure that you build with serial support as well: 
    west build -b nrf52dk_nrf52832 -p -- -DOVERLAY_CONFIG='overlay-serial.conf;'

    Best regards,
    Carl Richard

Reply
  • Hi again!

    You do not need MCUBoot with mcumgr. As explained in the Zephyr DFU documentation MCUBoot should be flashed initially, and then the application image can be upgraded using mcumgr. It's the DFU subsystem in the that interacts with MCUBoot, not mcumgr directly. 

    Are you using Zephyr standalone or the nRF Connect SDK? Below is some of the images that should be present in the zephyr folder after building with NCS:

    app_signed.hex
    app_test_update.hex
    app_to_sign.bin
    app_update.bin

    I'm not sure if Zephyr standalone does this signing process. If not you must sign the image as described in the SMP Server documentation. Make sure that you build with serial support as well: 
    west build -b nrf52dk_nrf52832 -p -- -DOVERLAY_CONFIG='overlay-serial.conf;'

    Best regards,
    Carl Richard

Children
No Data
Related