2021-01-12 07:41 AM
Hello,
I'm working with STM32H7 and STM32 Cube IDE,
I add this in linker script :
/* Memories definition */
MEMORY
{
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
}
/* Sections */
SECTIONS
{
.ramd2block :
{
. = ALIGN(4);
_sramd2block = .; /* create a global symbol at ccmram start */
*(.ramd2block)
*(.ramd2block*)
. = ALIGN(4);
_eramd2block = .; /* create a global symbol at ccmram end */
} > RAM_D2
.ramd3block (NOLOAD) :
{
KEEP(*(.ramd3section))
} > RAM_D3
But it keeps locating this buffer in DTCM RAM :
uint8_t SPI1_TxBuffer[READBACK_LENGTH] __attribute__(( section(".ramd2block") )); // SPI Tx
When I look in .map :
.ramd2block 0x00000000200001f8 0x1b load address 0x000000000800e2f4
.ramd2block 0x00000000200001f8 0x1b Core/Src/main.o
0x00000000200001f8 SPI1_TxBuffer
0x0000000020000214 . = ALIGN (0x4)
0x2000000 is in DTCM RAM
Any idea why isn't the linker locating my buffer in RAM_D2
Solved! Go to Solution.
2021-01-13 12:37 AM
Solved,
The file where to put custom RAM section is "STM32H743ZITX_FLASH.ld" and not "STM32H743ZITX_RAM.ld"
2021-01-12 10:07 AM
Try
uint8_t __attribute__(( section(".ramd2block"))) SPI1_TxBuffer[READBACK_LENGTH]; // SPI Tx
2021-01-13 12:05 AM
Hi,
It is still not working with this change
2021-01-13 12:37 AM
Solved,
The file where to put custom RAM section is "STM32H743ZITX_FLASH.ld" and not "STM32H743ZITX_RAM.ld"