2023-12-05 10:15 AM
Hi, I am working on a project with the STM32H730. In order to make full use of the onboard memory I have the project set up to load some objects into DTCMRAM. This works, however the binary size is huge, like 403 MB, and subsequently is crashing cube programmer:
It seems like something is going wrong here and a huge amount of unnecessary information is getting stored in the binary file.
Can you recommend a way to fix this while still using DTCMRAM for data?
Here is the DTCMRAM section of my linker file, and how I am allocating objects to DTCMRAM:
/* Define output sections */
SECTIONS
{
/* The startup code goes first into FLASH */
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} >FLASH
.dtcm_ram : {
. = ALIGN(4);
_sDTCMData=.;
*(.dtcm_ram)
.=ALIGN(4);
_eDTCMData=.; /* create a global symbol at DTCMData end */
} >DTCMRAM
2025-09-04 11:02 PM
Same thing happened to me, binary size 600+ Mbytes, but using D2 RAM. I need binary for bootloader, hence need to fix the issue. Nonetheless, the solution is using the noload directive like mentioned before in the thread. My working stm32h753vitx_flash.ld file included as attachment. If you remove the (noload) from .ethernet_data section the binary file size is 600+ Mbytes, with (noload) the size is as expected.
.ethernet_data (NOLOAD) : /* inside SECTIONS section, before /DISCARD/ */
{
*(.RxDescripSection)
*(.TxDescripSection)
*(.dma_buffer)
} >RAM_D2
2025-09-05 1:13 AM
Check the position of the COLON, I think it should be BEFORE (NOLOAD) not after it.
You can inspect the .ELF with OBJDUMP or FROMELF, and confirm the section has "NOBITS"
2025-09-05 2:55 AM
Does not compile if the colon is before (NOLOAD).
stm32h753vitx_flash.ld:181: syntax error