Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jul 10, 2023

Conversation

chris-durand
Copy link
Member

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.

Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

src/modm/platform/core/stm32/idtcm.ld.in Outdated Show resolved Hide resolved
@chris-durand chris-durand force-pushed the fix/stm32h7_data_section branch 2 times, most recently from face1d3 to a86fd05 Compare July 10, 2023 19:43
The data sections were previously placed into the first memory of the
contiguous section with the lowest address. The selection is changed
such that the first memory of the largest contiguous ram section is
used. For all supported Cortex-M devices except STM32H7 the resulting
linker script will be identical.

On STM32H7 .data is currently placed into the DTCM which is not
accessible by peripheral DMA transfers. With the new method the D1 AXI
SRAM is used for .data while .fastdata remains in the DTCM.
@chris-durand
Copy link
Member Author

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.

Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good, thank you, pls merge.

@salkinium salkinium added this to the 2023q3 milestone Jul 10, 2023
@chris-durand chris-durand merged commit 027811f into modm-io:develop Jul 10, 2023
13 checks passed
@chris-durand chris-durand deleted the fix/stm32h7_data_section branch July 10, 2023 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

Placement of data section in wrong memory for STM32H7
2 participants