Is the mcuboot supposed to be running during application time?

~Using nrf Connect sdk and toolchain at version V2.9.0

Attached is the app.zip project.

0334.app.zip

Basically it consists of a single main funct that prints ("AAAAAAAAAAA") to the screen.

What I've discovered is that during app runtime (when AAAAA ...is being printed to rtt) I can communicate with mcumgr or smpmgr

I want to put another application onto slot 0.

app2.zip

The output of the .bin files is show below

❯ find . -iname "*.bin"
./app/build_sdk_guide/app/zephyr/zephyr.bin
./app/build_sdk_guide/app/zephyr/zephyr.signed.bin
./app/build_sdk_guide/mcuboot/zephyr/zephyr.bin
./app2/build/app2/zephyr/zephyr.bin



Now the question(s) part.

  1. Why is mcuboot running during application runtime?
  2. Can I get it to only run during bootup? In the app dir under the .git logs you can see I have a file called my_defconfig....which is some of the behaviour i wanted during the mcuboot bootup.
  3. When trying to "mcumgr --conntype=serial --connstring='dev=/dev/ttyACM0,baud=115200' image upload $path/app2/zephyr/zyphyr.bin" I am unable to flash it. Using v2.6.1 and a west build command with -DMCUBOOT_OVERLAY_CONFIG we were able to get a app_update.bin generated. This allowed mcumgr to do a firmware update.
  4. Do I need to have mcuboot config info in the app2 build? The plan was to never jtag or nrfproj the chip again. All dfu would be done by uart during bootup, such that we only ever overwrite the slot 0 / app.

Regards,

Parents
  • Hi,

    Why is mcuboot running during application runtime?

    MCUboot does not run after starting the application. What is it you are seeing that indicate that it is? What is the initial proglem you are seeing?

    What I've discovered is that during app runtime (when AAAAA ...is being printed to rtt) I can communicate with mcumgr or smpmgr

    The application includes MCUmgr with UART transport. This means that images can be transfered when in the application (this is normally how it is done, and always if using transprots like BLE). However, serial transports (UART or USB) are supported both in the app and bootloader, so you can choose one or the other (or both).

    app_update.bin generated. This allowed mcumgr to do a firmware update.

    Yes, you need the app_udpate.bin or an update zip that incnludes it. Ths includes the trailer used by the bootloaer holding information like hash, version number, etc. I suggest gooing through Lesson 8 – Bootloaders and DFU/FOTA. You may also find these unofficial samples relevant.

  • Given that the v2.9.0 has moved away from the parent child setup. Where do i place the .conf info as shown in , does the fact I have config_mcumgr_params etc mean that it puts the smp_svr on the app, rather than in the Bootloader as shown in serial_recovery

    Are there any examples of the link using v2.9.0? I'm not sure where to put the my_defconfig (mcuboot.conf) file.

    I'm looking into sysbuild example

    Tak for hjælpen

Reply Children
  • Hi,

    You are right that configs and the build procedure is a bit different with sysbuild. You can refer to the smp_svr sample, which has support for sysbuild.

  • Why doesn't this sysbuild example build? I've attached the log.

     *  Executing task: nRF Connect: Generate config ubx_bmd360eval/nrf52811 for /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild 
    
    Building mcuboot_serial_recovery_uart_sysbuild
    west build --build-dir /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild --pristine --board ubx_bmd360eval/nrf52811 -- -DNCS_TOOLCHAIN_VERSION=NONE
    
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: /home/wtr/ncs/toolchains/b77d8c1312/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/wtr/.cache/zephyr
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: ubx_bmd360eval, qualifiers: nrf52811
    Parsing /home/wtr/ncs/v2.9.0/zephyr/share/sysbuild/Kconfig
    Loaded configuration '/home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/_sysbuild/empty.conf'
    Merged configuration '/home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/sysbuild.conf'
    Configuration saved to '/home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/zephyr/.config'
    Kconfig header saved to '/home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/_sysbuild/autoconf.h'
    -- 
       *****************************
       * Running CMake for mcuboot *
       *****************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/wtr/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr
    -- CMake version: 3.21.0
    -- Found Python3: /home/wtr/ncs/toolchains/b77d8c1312/usr/local/bin/python (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/wtr/.cache/zephyr
    -- Zephyr version: 3.7.99 (/home/wtr/ncs/v2.9.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: ubx_bmd360eval, qualifiers: nrf52811
    -- Found host-tools: zephyr 0.17.0 (/home/wtr/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (/home/wtr/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found Dtc: /home/wtr/ncs/toolchains/b77d8c1312/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/wtr/ncs/v2.9.0/zephyr/boards/u-blox/ubx_bmd360eval/ubx_bmd360eval_nrf52811.dts
    -- Found devicetree overlay: /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/sysbuild/mcuboot.overlay
    -- Generated zephyr.dts: /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot/zephyr/dts.cmake
    Parsing /home/wtr/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration '/home/wtr/ncs/v2.9.0/zephyr/boards/u-blox/ubx_bmd360eval/ubx_bmd360eval_nrf52811_defconfig'
    Merged configuration '/home/wtr/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration '/home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/sysbuild/mcuboot.conf'
    Merged configuration '/home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot/zephyr/.config.sysbuild'
    Configuration saved to '/home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot/zephyr/.config'
    Kconfig header saved to '/home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/wtr/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/wtr/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Setting build type to 'MinSizeRel' as none was specified.
    -- Using ccache: /home/wtr/ncs/toolchains/b77d8c1312/usr/bin/ccache
    CMake Warning at /home/wtr/ncs/v2.9.0/zephyr/CMakeLists.txt:952 (message):
      No SOURCES given to Zephyr library: drivers__console
    
      Excluding target from build.
    
    
    MCUBoot bootloader key file: /home/wtr/ncs/v2.9.0/bootloader/mcuboot/root-rsa-2048.pem
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot
    -- 
       ***********************************************************
       * Running CMake for mcuboot_serial_recovery_uart_sysbuild *
       ***********************************************************
    
    -- Application: /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild
    -- CMake version: 3.21.0
    -- Found Python3: /home/wtr/ncs/toolchains/b77d8c1312/usr/local/bin/python (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/wtr/.cache/zephyr
    -- Zephyr version: 3.7.99 (/home/wtr/ncs/v2.9.0/zephyr)
    Loading Zephyr default modules (Zephyr base).
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: ubx_bmd360eval, qualifiers: nrf52811
    -- Found host-tools: zephyr 0.17.0 (/home/wtr/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (/home/wtr/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found Dtc: /home/wtr/ncs/toolchains/b77d8c1312/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/wtr/ncs/v2.9.0/zephyr/boards/u-blox/ubx_bmd360eval/ubx_bmd360eval_nrf52811.dts
    -- Generated zephyr.dts: /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot_serial_recovery_uart_sysbuild/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot_serial_recovery_uart_sysbuild/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot_serial_recovery_uart_sysbuild/zephyr/dts.cmake
    
    warning: UPDATEABLE_IMAGE_NUMBER (defined at
    /home/wtr/ncs/v2.9.0/nrf/samples/common/mcumgr_bt_ota_dfu/Kconfig:89, subsys/dfu/Kconfig:95) was
    assigned the value '1' but got the value ''. Check these unsatisfied dependencies:
    (((BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS) && SOC_SERIES_NRF53X &&
    NCS_SAMPLE_MCUMGR_BT_OTA_DFU) || (!MCUBOOT && IMG_MANAGER)) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_UPDATEABLE_IMAGE_NUMBER and/or look up
    UPDATEABLE_IMAGE_NUMBER in the menuconfig/guiconfig interface. The Application Development Primer,
    Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
    helpful too.
    
    
    warning: MCUBOOT_UPDATE_FOOTER_SIZE (defined at subsys/dfu/Kconfig:54) was assigned the value
    '0x2000' but got the value ''. Check these unsatisfied dependencies: MCUBOOT_IMG_MANAGER (=n),
    IMG_MANAGER (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MCUBOOT_UPDATE_FOOTER_SIZE and/or look up
    MCUBOOT_UPDATE_FOOTER_SIZE in the menuconfig/guiconfig interface. The Application Development
    Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
    might be helpful too.
    
    Parsing /home/wtr/ncs/v2.9.0/zephyr/Kconfig
    Loaded configuration '/home/wtr/ncs/v2.9.0/zephyr/boards/u-blox/ubx_bmd360eval/ubx_bmd360eval_nrf52811_defconfig'
    Merged configuration '/home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/prj.conf'
    Merged configuration '/home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot_serial_recovery_uart_sysbuild/zephyr/.config.sysbuild'
    Configuration saved to '/home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot_serial_recovery_uart_sysbuild/zephyr/.config'
    Kconfig header saved to '/home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot_serial_recovery_uart_sysbuild/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/wtr/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/wtr/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Setting build type to 'MinSizeRel' as none was specified.
    -- Using ccache: /home/wtr/ncs/toolchains/b77d8c1312/usr/bin/ccache
    -- Including signing script: /home/wtr/ncs/v2.9.0/nrf/cmake/sysbuild/image_signing.cmake
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot_serial_recovery_uart_sysbuild
    CMake Warning at /home/wtr/ncs/v2.9.0/nrf/cmake/sysbuild/partition_manager.cmake:106 (message):
      
    
            ---------------------------------------------------------------------
            --- WARNING: Using a bootloader without pm_static.yml.            ---
            --- There are cases where a deployed product can consist of       ---
            --- multiple images, and only a subset of these images can be     ---
            --- upgraded through a firmware update mechanism. In such cases,  ---
            --- the upgradable images must have partitions that are static    ---
            --- and are matching the partition map used by the bootloader     ---
            --- programmed onto the device.                                   ---
            ---------------------------------------------------------------------
            
    
    Call Stack (most recent call first):
      /home/wtr/ncs/v2.9.0/nrf/cmake/sysbuild/partition_manager.cmake:634 (partition_manager)
      /home/wtr/ncs/v2.9.0/nrf/sysbuild/CMakeLists.txt:703 (include)
      cmake/modules/sysbuild_extensions.cmake:583 (nrf_POST_CMAKE)
      cmake/modules/sysbuild_extensions.cmake:583 (cmake_language)
      cmake/modules/sysbuild_images.cmake:23 (sysbuild_module_call)
      cmake/modules/sysbuild_default.cmake:20 (include)
      /home/wtr/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      /home/wtr/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      /home/wtr/ncs/v2.9.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build
    -- west build: building application
    [1/312] Preparing syscall dependency handling
    
    [7/312] Generating include/generated/zephyr/version.h
    -- Zephyr version: 3.7.99 (/home/wtr/ncs/v2.9.0/zephyr), build: v3.7.99-ncs2
    [307/312] Linking C executable zephyr/zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot/zephyr/zephyr_pre0.map 
    : && ccache /home/wtr/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -Os -DNDEBUG -gdwarf-4 -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=/home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/arch/arch/arm/core/mpu/libarch__arm__core__mpu.a  zephyr/lib/libc/minimal/liblib__libc__minimal.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/soc/soc/nrf52811/libsoc__nordic.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/flash/libdrivers__flash.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  modules/nrf/lib/fprotect/lib..__nrf__lib__fprotect.a  modules/mcuboot/boot/bootutil/zephyr/libmcuboot_util.a  modules/mbedtls/libmbedTLSBase.a  modules/mbedtls/libmbedTLSCrypto.a  modules/mbedtls/libmbedTLSX509.a  modules/mbedtls/libmodules__mbedtls.a  modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  modules/segger/libmodules__segger.a  modules/zcbor/libmodules__zcbor.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -L/home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot/zephyr  zephyr/arch/common/libisr_tables.a  modules/mbedtls/libmbedTLSBase.a  modules/mbedtls/libmbedTLSCrypto.a  modules/mbedtls/libmbedTLSX509.a  -mcpu=cortex-m4  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -fuse-ld=bfd  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie -L"/home/wtr/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v7e-m/nofp" -lc -lgcc && cd /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot/zephyr && /home/wtr/ncs/toolchains/b77d8c1312/usr/local/bin/cmake -E true
    /home/wtr/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/zephyr_pre0.elf section `noinit' will not fit in region `RAM'
    /home/wtr/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: region `RAM' overflowed by 3328 bytes
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    [10/20] No configure step for 'mcuboot_serial_recovery_uart_sysbuild'
    FAILED: _sysbuild/sysbuild/images/bootloader/mcuboot-prefix/src/mcuboot-stamp/mcuboot-build /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/_sysbuild/sysbuild/images/bootloader/mcuboot-prefix/src/mcuboot-stamp/mcuboot-build 
    cd /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build/mcuboot && /home/wtr/ncs/toolchains/b77d8c1312/usr/local/bin/cmake --build .
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /home/wtr/ncs/toolchains/b77d8c1312/usr/local/bin/cmake --build /home/wtr/work/nordicsemi_devzone/samples_for_nrf_connect_sdk/bootloader_samples/serial_recovery/mcuboot_serial_recovery_uart_sysbuild/build
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 
    



    Do i need to change the west build command?

  • Hi,

    The buildl og here shows that the RAM overflows:

    arm-zephyr-eabi/bin/ld.bfd: zephyr/zephyr_pre0.elf section `noinit' will not fit in region `RAM'
    /home/wtr/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: region `RAM' overflowed by 3328 bytes
  • Okay, I can see that. -___-

    Do you have any suggestions on how to reduce RAM usage.

    We can't use nordic chips if it's impossible to have a serial bootloader and a simple app that just prints A to the screen.
    There must be a trick that we've missed.

    I'm sitting on commit #e9457f6576 of https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk.git
    working on the

    mcuboot_serial_recovery_uart_sysbuild

    and the only change was to create a build configuration with the board
    --board ubx_bmd360eval/nrf52811

  • Hi,

    The nRF52811 is quite limited on RAM, but you should have no problem adjusting the RAM usage of this sample. Generally, default buffer sizes etc will not fit all use cases and need adjustment. As MCUboot does not fit in RAM here, you need to look at MCUboot memory usage. There are several tools that can help, but having a quick look in build/mcuboot/zephyr/.config after building the project I notice a very large main stack size. Maybe you can just reduce that? I would test first by setting CONFIG_MAIN_STACK_SIZE=6144 in sysbuild/mcuboot.conf. With that it builds, but you need to test to see if this stack size is actually large enough run time (I have not done that).

Related