cancel
Showing results for 
Search instead for 
Did you mean: 

How to use DTCMRAM in stm32h743

ykn
Senior

Hi All,

I want to use DTCRAM in stm32cubeide, the controller i used is stm32h743, earlier I

Used RAM_D2. shifting from RAM_D2 to DTCRAM is possible but both i cant use,

please guide me,

 

/DISCARD/ :
  {
    libc.a ( * )
    libm.a ( * )
    libgcc.a ( * )
  }
  .RAMD2buffers(NOLOAD) : {
    . = ALIGN(4);
    *(.buffers*)
  } > DTCMRAM
  
.bssDTCMRAM(NOLOAD) : {
    . = ALIGN(4);
    *(.buffersDT*)
  } > RAM_D2
  
  .ARM.attributes 0 : { *(.ARM.attributes) }

the above code is added to linker file,

//__attribute__ ((section(".buffers"), used))
char rData[BUF_SIZE];// Read data
__attribute__ ((section(".buffers"), used))
uint32_t DMA_ADC1[ADC1_Size];
__attribute__ ((section(".buffers"), used))
uint32_t DMA_ADC2[ADC2_Size];
__attribute__ ((section(".buffers"), used))
uint32_t DMA_ADC3[ADC3_Size];
__attribute__ ((section(".buffersDT")))
uint32_t DMA_ADC3_dummy[ADC3_Size];

 

this code added to main file, 

thanking you

12 REPLIES 12

 

 /DISCARD/ :
  {
    libc.a ( * )
    libm.a ( * )
    libgcc.a ( * )
  }
  
  .bssDTCMRAM(NOLOAD) : {
    . = ALIGN(4);
    *(.buffersDT*)
  } > DTCMRAM
  
  .RAMD2buffers(NOLOAD) : {
    . = ALIGN(4);
    *(.buffers*)
  } > RAM_D2

 

In this way, Now no initialization in DTCMRAM☹️

Pavel A.
Evangelist III

Now no initialization in DTCMRAM

Because in this line only "used" is missing )) This variable likely is not referenced.

__attribute__ ((section(".buffersDT")))

Please read the ld documentation, take your time.

Pick less ambiguous patterns.

File is processed in-order, variables need to be used or dead-code elimination will discard them 

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