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

  • I'm working with the nRF Connect SDK. The path in my previous reply was relative. My fault... i'm building the software over command line like follows:

    smp_svr:

    west build -b nrf52dk_nrf52832 -s app --pristine -d build\app -- -DOVERLAY_CONFIG='overlay-serial.conf;overlay-fs.conf'
    mcuboot:
    west build -b nrf52dk_nrf52832 -s ..\ncs\bootloader\mcuboot\boot\zephyr\ --pristine -d build\bootloader
    The smp_svr project was copied to <project-name>/<app>
    Kind regards,
    Michael
  • Hi, Michael!

    I understand. With NCS the bootloader is built automatically and added in the build folder, so there should not be any need to build it separately. Could you have a look at the contents in your build/app folder? It should contain something like this:

    d-----        09.03.2021     14:19                app
    d-----        09.03.2021     14:19                CMakeFiles
    d-----        09.03.2021     14:19                Kconfig
    d-----        09.03.2021     14:19                mcuboot
    d-----        09.03.2021     14:19                modules
    d-----        09.03.2021     14:19                zephyr
    -a----        09.03.2021     14:19         103504 .ninja_deps
    -a----        09.03.2021     14:19          24897 .ninja_log
    -a----        09.03.2021     14:19         925615 build.ninja
    -a----        09.03.2021     14:19          21613 CMakeCache.txt
    -a----        09.03.2021     14:19           1839 cmake_install.cmake
    -a----        09.03.2021     10:37          17920 libapp.a
    -a----        09.03.2021     14:19           1221 partitions.yml
    -a----        09.03.2021     14:19           2136 pm.config
    -a----        09.03.2021     14:19            327 regions.yml
    -a----        09.03.2021     14:19           1877 zephyr_modules.txt
    -a----        09.03.2021     14:19             84 zephyr_settings.txt


    Best regards,
    Carl Richard

Reply
  • Hi, Michael!

    I understand. With NCS the bootloader is built automatically and added in the build folder, so there should not be any need to build it separately. Could you have a look at the contents in your build/app folder? It should contain something like this:

    d-----        09.03.2021     14:19                app
    d-----        09.03.2021     14:19                CMakeFiles
    d-----        09.03.2021     14:19                Kconfig
    d-----        09.03.2021     14:19                mcuboot
    d-----        09.03.2021     14:19                modules
    d-----        09.03.2021     14:19                zephyr
    -a----        09.03.2021     14:19         103504 .ninja_deps
    -a----        09.03.2021     14:19          24897 .ninja_log
    -a----        09.03.2021     14:19         925615 build.ninja
    -a----        09.03.2021     14:19          21613 CMakeCache.txt
    -a----        09.03.2021     14:19           1839 cmake_install.cmake
    -a----        09.03.2021     10:37          17920 libapp.a
    -a----        09.03.2021     14:19           1221 partitions.yml
    -a----        09.03.2021     14:19           2136 pm.config
    -a----        09.03.2021     14:19            327 regions.yml
    -a----        09.03.2021     14:19           1877 zephyr_modules.txt
    -a----        09.03.2021     14:19             84 zephyr_settings.txt


    Best regards,
    Carl Richard

Children
No Data
Related