Example of CONFIG_MCUBOOT_BUILD_STRATEGY_USE_HEX_FILE usage

Hi,

I have read the thread here:  specify MCUBOOT project or build out of ncs repo which implies that this config option might not work?

Does it work? I would like to build mcuboot and then always use the same binary for future releases - this way, all our devices will be using the same copy of mcuboot.

I first built using the default strategy, then I copied build/mcuboot/zephyr/zephyr.hex to eg my home directory.

Then I set

CONFIG_MCUBOOT_BUILD_STRATEGY_USE_HEX_FILE=y
CONFIG_MCUBOOT_HEX_FILE="/home/wayne/mcuboot.hex"

Then I deleted build directory and rebuilt it as before - it "builds", but the resulting build is broken.

Does this work? How should it be setup? I am using NCS v1.8.0 due to AT&T compliance.

  • Hi,

    I have picked up your case and will be taking a closer look into this tomorrow. However, due to the main summer vacation period here in Norway, response time might be a bit longer than normal. Hopefully I I have a reply for you before the weekend/early next working week.

    Kind regards,
    Andreas

  • Hi,

    Based on some feedback after discussing this with my colleague we landed on a couple of points we need to get more information about

    which implies that this config option might not work?

    The configuration exists here, so it should work.

    Does it work?

    It should work yes, but how to do it is not straight forward.  As stated in the case you linked, it is stated "the partition manager requires to know a bit more than just the .hex location". As far as I can see you've only given the pm the hex location and some more setup is required.

    Then I deleted build directory and rebuilt it as before - it "builds", but the resulting build is broken.

    Could you explain what you mean by "broken" by supplying a build log?

    How should it be setup?

    I've asked around and we do not have any samples available for this, other than using either similarly looking cases on devzone and our doc-api. 

    Kind regards,
    Andreas

  • Hi Devzone,

    I would love a working answer to this as well!

    When I try to configure my project to use a prebuilt hex file, I get the following errors at build time.

    Thanks!

    === child image hci_rpmsg - CPUNET end ===
    
    Using /Users/blake/co/firmware-nrf-zephyr/workspace/widget/apps/tracker/nrf5340/mcuboot-6115.hex instead of building mcuboot
    
    === child image s1_image -  begin ===
    CMake Error at /Users/blake/co/firmware-nrf-zephyr/workspace/nrf/cmake/multi_image.cmake:229 (get_property):
      get_property could not find TARGET mcuboot_subimage.  Perhaps it has not
      yet been created.
    Call Stack (most recent call first):
      /Users/blake/co/firmware-nrf-zephyr/workspace/nrf/cmake/multi_image.cmake:150 (add_child_image_from_source)
      /Users/blake/co/firmware-nrf-zephyr/workspace/nrf/modules/mcuboot/CMakeLists.txt:222 (add_child_image)
    
    
    CMake Error at /Users/blake/co/firmware-nrf-zephyr/workspace/nrf/cmake/multi_image.cmake:235 (get_property):
      get_property could not find TARGET mcuboot_subimage.  Perhaps it has not
      yet been created.
    Call Stack (most recent call first):
      /Users/blake/co/firmware-nrf-zephyr/workspace/nrf/cmake/multi_image.cmake:150 (add_child_image_from_source)
      /Users/blake/co/firmware-nrf-zephyr/workspace/nrf/modules/mcuboot/CMakeLists.txt:222 (add_child_image)
    
    
    CMake Error: -C must be followed by a file name.
    CMake Error: Run 'cmake --help' for all supported options.
    CMake Error at /Users/blake/co/firmware-nrf-zephyr/workspace/nrf/cmake/multi_image.cmake:409 (message):
      CMake generation for s1_image failed, aborting.  Command: 1
    Call Stack (most recent call first):
      /Users/blake/co/firmware-nrf-zephyr/workspace/nrf/cmake/multi_image.cmake:150 (add_child_image_from_source)
      /Users/blake/co/firmware-nrf-zephyr/workspace/nrf/modules/mcuboot/CMakeLists.txt:222 (add_child_image)
    
    
    -- Configuring incomplete, errors occurred!

  • Hi,

    If you create a new ticket with your question (and related information if there are any in this thread), we will assign it to someone and answer your questions there! 

    Kind regards,
    Andreas

Related