Skip to content

Commit 651798a

Browse files
committed
soc: arm: stm32h7: expand linker with sram sections 1 to 3
In zephyrproject-rtos#53184 a linker section for SRAM4 was added because it's required for use with the STM32H7 BDMA. Now in zephyrproject-rtos#52965 support was added for the ADC DMA which expects a similar linker section which is non-cachable, but is limited to use SRAM4 to place it's buffers. This commit gives the user more flexibility to use any SRAM region to place buffers to use with ADC DMA. The region SRAM0 isn't supported because it doesn't have the "zephyr,memory-region" compatibility required to turn it into a non-cacheable region, meaning it doesn't fit the mentioned use case. Signed-off-by: Hein Wessels <[email protected]>
1 parent 67d851f commit 651798a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

soc/arm/st_stm32/stm32h7/sections.ld

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,33 @@ SECTION_DATA_PROLOGUE(eth_stm32,(NOLOAD),)
2626
#endif
2727
#endif
2828

29+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(sram1), okay)
30+
SECTION_PROLOGUE (sram1, ABSOLUTE(DT_REG_ADDR(DT_NODELABEL(sram1))) (NOLOAD),)
31+
{
32+
__sram1_start = .;
33+
KEEP(*(SORT_BY_NAME(".sram1*")))
34+
__sram1_end = .;
35+
} GROUP_DATA_LINK_IN(SRAM1, SRAM1)
36+
#endif /* DT_NODE_HAS_STATUS(DT_NODELABEL(sram1), okay) */
37+
38+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(sram2), okay)
39+
SECTION_PROLOGUE (sram2, ABSOLUTE(DT_REG_ADDR(DT_NODELABEL(sram2))) (NOLOAD),)
40+
{
41+
__sram2_start = .;
42+
KEEP(*(SORT_BY_NAME(".sram2*")))
43+
__sram2_end = .;
44+
} GROUP_DATA_LINK_IN(SRAM2, SRAM2)
45+
#endif /* DT_NODE_HAS_STATUS(DT_NODELABEL(sram2), okay) */
46+
47+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(sram3), okay)
48+
SECTION_PROLOGUE (sram3, ABSOLUTE(DT_REG_ADDR(DT_NODELABEL(sram3))) (NOLOAD),)
49+
{
50+
__sram3_start = .;
51+
KEEP(*(SORT_BY_NAME(".sram3*")))
52+
__sram3_end = .;
53+
} GROUP_DATA_LINK_IN(SRAM3, SRAM3)
54+
#endif /* DT_NODE_HAS_STATUS(DT_NODELABEL(sram3), okay) */
55+
2956
#if DT_NODE_HAS_STATUS(DT_NODELABEL(sram4), okay)
3057
SECTION_PROLOGUE (sram4, ABSOLUTE(DT_REG_ADDR(DT_NODELABEL(sram4))) (NOLOAD),)
3158
{

0 commit comments

Comments
 (0)