modm-io / modm

modm: a C++23 library generator for AVR and ARM Cortex-M devices
https://modm.io
Mozilla Public License 2.0
748 stars 132 forks source link

[stm32] Place .data section into D1_SRAM instead of DTCM for H7 #1048

Closed chris-durand closed 1 year ago

chris-durand commented 1 year ago

This changes the method for choosing the memory that will contain the RAM data sections. Previously the first memory of the contiguous region with the lowest address was selected. Now the first memory of the largest region will be selected instead.

On STM32H7 the .data and .bss sections were previously put into the DTCM which is not accessible by peripheral DMA transfers. They will now be placed into the D1 AXI SRAM with the updated selection method.

For all other supported Cortex-M devices the generated linker script will be identical. All targets except STM32H7, STM32U5 and SAMD/E5x only have one contiguous region anyway and for STM32U5 and SAMD/E5x the set contains the main RAM region and additional small SRAMs. I have verified at least one generated linker script for every linker script template and only copyright headers and white space changed.

chris-durand commented 1 year ago

Could you check if the linker layout maps in the module description need to be adapted? Or were they already correct?

I have updated the description.