2024-03-28 06:39 AM
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
Solved! Go to Solution.
2024-03-29 03:39 AM - edited 2024-03-29 03:56 AM
/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:frowning_face:
2024-03-29 02:44 PM
> 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.
2024-03-29 02:59 PM
Pick less ambiguous patterns.
File is processed in-order, variables need to be used or dead-code elimination will discard them