Skip to main content
JBias
Associate III
May 28, 2025
Question

STM32H7 with DTCM of 192K getting elf load problem with debugger

  • May 28, 2025
  • 2 replies
  • 498 views

I'm using the NUCLEO-H7S3L8 and have it setup 192K of DTCM memory. However, when I start to allocate DTCM memory above 64K the .elf file fails to load in the debugger. If I stay below 64K not a problem.

 

JBias_0-1748441259001.png

volatile uint8_t __attribute__((section (".dtcm_data"))) __attribute__((aligned(32))) gShadowPQ_WFB[65536] = {1, 2, 3, 4, 5, 6, 7, 8};
volatile uint8_t __attribute__((section (".dtcm_data"))) __attribute__((aligned(32))) gShadowS1_WFB[8192]; //<-- gives problems with loading of STS_Bias.elf

 

 

2 replies

TDK
Super User
May 28, 2025

Did you set DTCM_AXI_SHARED option byte to allocate the max 192 kB to DTCM? Show in CubeProgrammer.

TDK_0-1748442625199.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
JBias
JBiasAuthor
Associate III
May 28, 2025

@TDK I set these bits via the MX tool:

JBias_0-1748454404289.png

and they appear to increase the memory size. However, specifying more than 64K in my code results in the .elf file not being able to be loaded in the debugger

Pavel A.
Super User
May 28, 2025
.dtcm_data :
{
 . = ALIGN(4);
 *(.dtcm_data) /* Include data */
 . = ALIGN(4);
} AT> DTCM

In this part of the .ld file, remove "AT" .  If you want initialized data in DTCM or ITCM, please check examples.

For simplicity and robustness,  initialize variables in non-default data segments in runtime. Compile-time initialization requires extra code and is error-prone.

 

 

 

JBias
JBiasAuthor
Associate III
May 28, 2025

Thanks this is good to know. I do not need to have them initialized at all, I just did so for debug purposes. However, I still have the same issue with the .elf file not being able to be loaded if I specify more than 64K in the DTCM area. I want to place some large arrays that are at max 64K and just can not seem to be able to do so without the elf file not wanting to load.

Pavel A.
Super User
May 28, 2025

Then there should be other problems in the ld file or in the code. 

Try to obtain more detailed log of the debugger.