Warning FLASH_SIMULATOR unassigned starting from NCS SDK 2.7.0 due to missing default flash_sim.overlay from build

I have found that in NCS SDK 2.6.2 it was very simple to enable FLASH_SIMULATOR as part of the mcuboot configuration overlays. But starting from SDK 2.7.0, I keep getting the following warnings:

warning: FLASH_SIMULATOR (defined at drivers/flash/Kconfig.simulator:6) was assigned the value 'y'
but got the value 'n'. Check these unsatisfied dependencies: DT_HAS_ZEPHYR_SIM_FLASH_ENABLED (=n).
See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_FLASH_SIMULATOR and/or look up
FLASH_SIMULATOR 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: FLASH_SIMULATOR_DOUBLE_WRITES (defined at drivers/flash/Kconfig.simulator:42) was assigned
the value 'y' but got the value 'n'. Check these unsatisfied dependencies: FLASH_SIMULATOR (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES and/or look
up FLASH_SIMULATOR_DOUBLE_WRITES 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.

By examining some of my application's build artifacts built under SDK 2.6.2, I see that the flash_sim.overlay was being added by default to the build in the following in build/CMakeCache.txt:

//Default mcuboot configuration file
mcuboot_DTC_OVERLAY_FILE:STRING=/opt/nordic/ncs/v2.6.2/nrf/modules/mcuboot/flash_sim.overlay;/opt/nordic/ncs/v2.6.2/nrf/modules/mcuboot/usb.overlay;/Users/alfredoantolinez/dev/sensor_wearable/wearable/child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.overlay

When looking at the same file under a build with 2.7.0 and up, I only see:

//devicetree overlay file defined by main application
mcuboot_DTC_OVERLAY_FILE:INTERNAL=/{MYPROJPATH}/sysbuild/mcuboot.overlay

I imagine this is a product of switching to sysbuild and possibly providing flexibility to the user to use or not whatever they want for their builds. But I do liked the option to use the overlay provided by Nordic for this functionality.

What is the proper way to enable FLASH_SIMULATOR and including the flash_sim.overlay from Nordic starting from 2.7.0 as it is not clear to me?

I tried to add the following line in the project's CMakeLists.txt file right under the 

cmake_minimum_required
:

set(mcuboot_DTC_OVERLAY_FILE ${ZEPHYR_BASE}/../nrf/modules/mcuboot/flash_sim.overlay)

But that does not seem to be doing anything to the build.

Any help would be appreciated.

Thank you,

Alfredo

Parents
  • Sorry for the delayed response Alfredo,

    The configuration option SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y plays a crucial role in the memory management and partitioning scheme used in sysbuild, particularly when working with MCUBoot and external flash memory in Nordic's NCS. The assertion you encountered likely occurred because MCUBoot was unable to locate or allocate memory for the secondary slot. Without SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY, sysbuild seems to default to placing the secondary slot in internal flash, which might conflict with other partitions or exceed available memory.

Reply
  • Sorry for the delayed response Alfredo,

    The configuration option SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y plays a crucial role in the memory management and partitioning scheme used in sysbuild, particularly when working with MCUBoot and external flash memory in Nordic's NCS. The assertion you encountered likely occurred because MCUBoot was unable to locate or allocate memory for the secondary slot. Without SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY, sysbuild seems to default to placing the secondary slot in internal flash, which might conflict with other partitions or exceed available memory.

Children
Related