Building MCUBoot separate from application.

Hi there,

Our current understanding is that when building an application using NCS, the images of of MCUBoot and the application gets merged into merged.hex.

We however would like to be able to build MCUBoot in its own seperate project (SES/VS Code). This will allow us to easily customize the bootloader where needed and also access the sources:

1) Is this possible? Is there an example project for this?

2) Please provide information on how to set this up/configure/build MCUBoot separately.

Our application is developed in IAR, using a different OS than Zephyr. This thus requires us to build MCUBoot separately. We will then boot from MCUBoot using Zephyr, into our application using a different OS.

3) If not possible to build separately, will we be able to use an example project (e.g. blinky), configure the bootloader from there, and just use the child image generated for the bootloader before merged.hex is created, in order to boot into our application?

Kind regards,

Frikkie Badenhorst

Parents
  • Hi Frikkie,

    We however would like to be able to build MCUBoot in its own seperate project (SES/VS Code). This will allow us to easily customize the bootloader where needed and also access the sources:

    1) Is this possible? Is there an example project for this?

    Yes, it should be possible to build MCUboot as a separate project. You can find more information about bootloader and mcuboot repositories on bootloader, mcuboot and sdk-mcuboot.


    2) Please provide information on how to set this up/configure/build MCUBoot separately.

    This is dependent on the operating system you choose. We have extensive documentation regarding bootloader and building and using MCUboot with Zephyr.

    Best regards,
    Dejan

  • Hello,

    sorry to border you but i'm stucked in the building procedure of the mcuboot.

    I'm following that  documentation Build MCUBoot with zephyr but i can not undestand this command:
    "cmake -GNinja -DBOARD=<board> .."

    Which is the file that i have to put instead of "borad"? Which is the right path?
    Every time that i insert a board i receive back from the cmc "Access Denied".
    Can you provide me an example about this command?

    Thank's for your help

  • I uninstalled ALL instances of the SDK in the toolchain manager and only installed the latest v1.9.1.

    Still, we have the same issue:

    Microsoft Windows [Version 10.0.19043.1586]
    (c) Microsoft Corporation. All rights reserved.
    
    
    C:\nordic\v1.9.1\bootloader\mcuboot>cd boot/zephyr
    
    C:\nordic\v1.9.1\bootloader\mcuboot\boot\zephyr>mkdir build && cd build
    A subdirectory or file build already exists.
    
    C:\nordic\v1.9.1\bootloader\mcuboot\boot\zephyr>cmake -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp
    CMake Warning:
      No source or binary directory provided.  Both will be assumed to be the
      same as the current working directory, but note that this warning will
      become a fatal error in future CMake releases.
    
    
    Including boilerplate (Zephyr workspace): C:/nordic/v1.9.1/zephyr/cmake/app/boilerplate.cmake
    -- Application: C:/nordic/v1.9.1/bootloader/mcuboot/boot/zephyr
    -- Using NCS Toolchain 1.9.1 for building. (C:/nordic/v1.9.1/toolchain/cmake)
    -- Zephyr version: 2.7.99 (C:/nordic/v1.9.1/zephyr), build: v2.7.99-ncs1-1
    -- Found Python3: C:/nordic/v1.9.1/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    CMake Error at C:/nordic/v1.9.1/zephyr/cmake/app/boilerplate.cmake:174 (file):
      file problem creating directory:
      C:/nordic/v1.9.1/bootloader/mcuboot/boot/zephyr/Kconfig
    Call Stack (most recent call first):
      C:/nordic/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
      C:/nordic/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:91 (include_boilerplate)
      CMakeLists.txt:44 (find_package)
    
    
    CMake Error at C:/nordic/v1.9.1/zephyr/cmake/zephyr_module.cmake:61 (message):
      Traceback (most recent call last):
    
        File "C:/nordic/v1.9.1/zephyr/scripts/zephyr_module.py", line 542, in <module>
          main()
        File "C:/nordic/v1.9.1/zephyr/scripts/zephyr_module.py", line 508, in main
          with open(args.kconfig_out, 'w', encoding="utf-8") as fp:
    
      FileNotFoundError: [Errno 2] No such file or directory:
      'C:/nordic/v1.9.1/bootloader/mcuboot/boot/zephyr/Kconfig/Kconfig.modules'
    
    Call Stack (most recent call first):
      C:/nordic/v1.9.1/zephyr/cmake/app/boilerplate.cmake:175 (include)
      C:/nordic/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
      C:/nordic/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:91 (include_boilerplate)
      CMakeLists.txt:44 (find_package)
    
    
    -- Configuring incomplete, errors occurred!

  • Hi,

    There is an obvious error of missing Kconfig.modules. 

    It is not usual to build bootloader separately. You could consider using provided MCUboot with NCS and changing it according to your particular needs.

    I have made a report internally in the effort to assist you.
    I'll come back to you with more information.

    Best regards,
    Dejan

  • Hi,

    As I have already suggested to you, building MCUboot separately from the application is not recommended. If you still insist on doing so, you would need to ensure that configuration for the images and key matches the way they should. In addition, your cmake is invoked from the application folder instead of build folder and your environment is not setup correctly.
    The best way forward would probably be not to build MCUboot separately from the application.

    Best regards,
    Dejan

Reply Children
No Data
Related