Skip to main content
Associate III
May 28, 2025
Solved

How to use DTCM RAM?

  • May 28, 2025
  • 3 replies
  • 823 views

I'd like to use the DTCM ram in my code; how can I do ?

 

Thank you

Best answer by Tesla DeLorean

Describe the memory regions in your linker script or scatter file.

Use compiler directives say attributes or pragmas to direct specific code, or buffers to use the memory.

Code in specific source files, via object file, can be directed via linker scripts

A for filling/preloading DTCM, for GNU/GCC you'd need to add initialization code in startup.s and staging via the linker script, in a similar manner to how statics are handled for RAM from FLASH

3 replies

TDK
Super User
May 28, 2025
"If you feel a post has answered your question, please click ""Accept as Solution""."
carloVAuthor
Associate III
May 28, 2025

Thank you,

I know that is very important to understand the MPU architecture, but what I need to know is:

in what way can I insert in my project some lines of code that  make that type of memory (DTCM, ITCM,...) usage available  to my project.

 

 

Andrew Neil
Super User
May 28, 2025

You would do this in the Linker script (the .ld file, for CubeIDE) rather than in the code.

The thread @TDK linked says, "See also X-CUBE-PERF-H7 (related to the said application note) how linker files are implemented" ...

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
David Littell
Senior II
January 10, 2026

<deleted>

David Littell
Senior II
January 24, 2026

<deleted>

Andrew Neil
Super User
January 26, 2026

@David Littell wrote:

 This brain-damaged forum software doesn't seem to allow me to remove my own post.


But you can edit your post ...

You can use the 'Feedback' forum to give feedback on the forum itself:

https://community.st.com/t5/feedback-forum/bd-p/feedback-forum

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
LCE
Principal II
January 26, 2026

Note on DTCM usage:

some DMA controllers (I think most except for MDMA) cannot access DTCM.

Check the reference manual.