Hi
The NCS version is 2.1.0
How to use a prebuilt (MCUBOOT)HEX file of the child image and include it with the parent image?
Can you give me a sample?
Thank you.
Hi
The NCS version is 2.1.0
How to use a prebuilt (MCUBOOT)HEX file of the child image and include it with the parent image?
Can you give me a sample?
Thank you.
Hello,
The build strategy for child images and example for MCUBOOT is explained here:
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.3/nrf/ug_multi_image.html#default-configuration
There are 3 konfig options that control build strategy:
CONFIG_MCUBOOT_BUILD_STRATEGY_FROM_SOURCE Build from source (default)
CONFIG_MCUBOOT_BUILD_STRATEGY_SKIP_BUILD Skip building MCUBOOT
CONFIG_MCUBOOT_BUILD_STRATEGY_USE_HEX_FILE Use hex file instead of building MCUBOOT
CONFIG_MCUBOOT_HEX_FILE MCUBOOT hex file
How to:
Configure build and flash the initial project with all child images (using CONFIG_MCUBOOT_BUILD_STRATEGY_FROM_SOURCE).
Next, copy the generated pm.config out to the application dir, rename to pm_static.yml and set the "*_BUILD_STRATEGY_*" according to what you want:
If MCUBOOT remain programmed on the device all the time? Just use the "CONFIG_MCUBOOT_BUILD_STRATEGY_SKIP_BUILD" strategy, and west flash will only flash the application image.
If you are erasing the device between programming you can select the "CONFIG_MCUBOOT_BUILD_STRATEGY_USE_HEX_FILE" build strategy and point to the already built hex file for MCUBOOT (using CONFIG_MCUBOOT_HEX_FILE) to get it programmed when doing west flash.
Some useful links for description of the config option for build strategy:
https://github.com/nrfconnect/sdk-nrf/blob/v2.1.3/subsys/partition_manager/Kconfig.template.build_strategy#L5
https://github.com/nrfconnect/sdk-nrf/blob/v2.1.3/subsys/partition_manager/Kconfig.template.build_strategy#L19
Additional comment:
If you are using nRF Secure Immutable Bootloader (NSIB) in addition to MCUBOOT, you can also control the build strategy the same way.
Hope it helps,
Kenneth