Skip to content

Commit 8e87dd4

Browse files
krish2718rlubos
authored andcommitted
cmake: pm: Add a property for nRF70 firmware patch absolute address
nRF70 firmware patch hex file generation needs absolute address in the external flash, and due to the way generator expressions are used it's not easy to do this in the nRF70 driver cmake, so, add a property that after calculation that can be used by nRF70 driver. Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
1 parent ba27313 commit 8e87dd4

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

cmake/partition_manager.cmake

+27
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,33 @@ if (CONFIG_SECURE_BOOT AND CONFIG_BOOTLOADER_MCUBOOT)
487487
)
488488
endif()
489489

490+
# Calculate absolute address for the wi-fi firmware patch location.
491+
if (CONFIG_WIFI_NRF700X AND CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE)
492+
if(DEFINED ext_flash_dev)
493+
get_filename_component(qspi_node ${ext_flash_dev} DIRECTORY)
494+
else()
495+
dt_nodelabel(qspi_node NODELABEL "qspi")
496+
endif()
497+
if(DEFINED qspi_node)
498+
dt_reg_addr(xip_addr PATH ${qspi_node} NAME qspi_mm)
499+
if(NOT DEFINED xip_addr)
500+
message(WARNING "\
501+
Could not find memory mapped address for XIP. Generated update hex files will \
502+
not have the correct base address. Hence they can not be programmed directly \
503+
to the external flash")
504+
endif()
505+
else()
506+
set(xip_addr 0)
507+
endif()
508+
509+
math(EXPR wifi_fw_abs_addr "${xip_addr} + ${PM_NRF70_WIFI_FW_OFFSET}")
510+
set_property(
511+
TARGET partition_manager
512+
PROPERTY nrf70_wifi_fw_XIP_ABS_ADDR
513+
${wifi_fw_abs_addr}
514+
)
515+
endif()
516+
490517
if (is_dynamic_partition_in_domain)
491518
# We are being built as sub image.
492519
# Expose the generated partition manager configuration files to parent image.

0 commit comments

Comments
 (0)