Skip to content

Conversation

@heinwessels
Copy link
Contributor

In #53184 a linker section for SRAM4 was added because it's required for use with the STM32H7 BDMA. Now in #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.

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]>
@heinwessels
Copy link
Contributor Author

Closing this, as this is not the correct way to define linker sections. It's already generated automatically for regions in the DTS with the "zephyr,memory-region" compatibility.

@erwango
Copy link
Member

erwango commented Mar 24, 2023

@heinwessels I wonder about the difference between this and the use of dt prop zephyr,memory-region.
Use of zephyr,memory-region will generate the following in final generated linker file (build/zephyr/liner.cmd):

SRAM3 805568512 (NOLOAD) : {
 __SRAM3_start = .;
 KEEP(*(SRAM3)) KEEP(*(SRAM3.*))
 __SRAM3_end = .;
 } > SRAM3
 __SRAM3_size = __SRAM3_end - __SRAM3_start;
 __SRAM3_load_start = LOADADDR(SRAM3);
 

@erwango
Copy link
Member

erwango commented Mar 24, 2023

:-D

@heinwessels
Copy link
Contributor Author

I rather created a PR to remove generating a linker section manually in #56177

@heinwessels heinwessels deleted the stm32-sections branch March 27, 2023 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: STM32 ST Micro STM32

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants