Skip to content

Commit 0d185f0

Browse files
Jordan Yatescarlescufi
authored andcommitted
cmake: zephyr_linker_dts_memory auto-name
Update the linker script generator to automatically derive memory region names from the devicetree node according to the same logic in `devicetree_regions.h`. Signed-off-by: Jordan Yates <[email protected]>
1 parent 7b2a388 commit 0d185f0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmake/extensions.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3377,9 +3377,14 @@ function(zephyr_linker_dts_memory)
33773377

33783378
dt_reg_addr(addr PATH ${DTS_MEMORY_PATH})
33793379
dt_reg_size(size PATH ${DTS_MEMORY_PATH})
3380+
dt_prop(name PATH ${DTS_MEMORY_PATH} PROPERTY "memory-region")
3381+
if (NOT DEFINED name)
3382+
# Fallback to the node path
3383+
set(name ${DTS_MEMORY_PATH})
3384+
endif()
33803385

33813386
zephyr_linker_memory(
3382-
NAME ${DTS_MEMORY_NAME}
3387+
NAME ${name}
33833388
START ${addr}
33843389
SIZE ${size}
33853390
FLAGS ${DTS_MEMORY_FLAGS}

0 commit comments

Comments
 (0)