cancel
Showing results for 
Search instead for 
Did you mean: 

Extremely Large Binary Size When Using DTCMRAM

EPala.2
Associate III

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:

Screen Shot 2023-12-05 at 9.08.12 AM.png

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

Screenshot 2023-12-05 at 1.12.44 PM.png

 

12 REPLIES 12
toroid
Associate III

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

 

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"

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Does not compile if the colon is before (NOLOAD).

stm32h753vitx_flash.ld:181: syntax error