Skip to content

Commit cc126a7

Browse files
joerchannordicjm
authored andcommitted
cmake: sysbuild: partition_manager: Handle region kconfig disabled
The ram_flash region has FLASH_SIMULATOR as its default driver Kconfig. If the flash-simulator has been disabled in the build then this will cause a partition manager error. Add check for flash simulator being enabled. Signed-off-by: Joakim Andersson <[email protected]>
1 parent 03778cc commit cc126a7

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

cmake/sysbuild/partition_manager.cmake

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -607,25 +607,29 @@ if(ext_flash_enabled)
607607
)
608608
endif()
609609

610-
# If simultaneous updates of the network core and application core is supported
611-
# we add a region which is used to emulate flash. In reality this data is being
612-
# placed in RAM. This is used to bank the network core update in RAM while
613-
# the application core update is banked in flash. This works since the nRF53
614-
# application core has 512kB of RAM and the network core only has 256kB of flash
615-
if(SB_CONFIG_NETCORE_APP_UPDATE)
616-
# This region will contain the 'mcuboot_secondary' partition, and the banked
617-
# updates for the network core will be stored here.
618-
sysbuild_get(ram_flash_addr IMAGE mcuboot VAR RAM_FLASH_ADDR CACHE)
619-
sysbuild_get(ram_flash_size IMAGE mcuboot VAR RAM_FLASH_SIZE CACHE)
610+
if(SB_CONFIG_BOOTLOADER_MCUBOOT)
611+
sysbuild_get(ram_flash_enabled IMAGE mcuboot VAR CONFIG_FLASH_SIMULATOR KCONFIG)
612+
613+
# If simultaneous updates of the network core and application core is supported
614+
# we add a region which is used to emulate flash. In reality this data is being
615+
# placed in RAM. This is used to bank the network core update in RAM while
616+
# the application core update is banked in flash. This works since the nRF53
617+
# application core has 512kB of RAM and the network core only has 256kB of flash
618+
if(SB_CONFIG_NETCORE_APP_UPDATE AND ram_flash_enabled)
619+
# This region will contain the 'mcuboot_secondary' partition, and the banked
620+
# updates for the network core will be stored here.
621+
sysbuild_get(ram_flash_addr IMAGE mcuboot VAR RAM_FLASH_ADDR CACHE)
622+
sysbuild_get(ram_flash_size IMAGE mcuboot VAR RAM_FLASH_SIZE CACHE)
620623

621-
add_region(
622-
NAME ram_flash
623-
SIZE ${ram_flash_size}
624-
BASE ${ram_flash_addr}
625-
PLACEMENT start_to_end
626-
DEVICE nordic_ram_flash_controller
627-
DEFAULT_DRIVER_KCONFIG CONFIG_FLASH_SIMULATOR
628-
)
624+
add_region(
625+
NAME ram_flash
626+
SIZE ${ram_flash_size}
627+
BASE ${ram_flash_addr}
628+
PLACEMENT start_to_end
629+
DEVICE nordic_ram_flash_controller
630+
DEFAULT_DRIVER_KCONFIG CONFIG_FLASH_SIMULATOR
631+
)
632+
endif()
629633
endif()
630634

631635
# Do per domain, end with main app domain.

0 commit comments

Comments
 (0)