Move object (.obj) to external SRAM
Hello,
Trying to move complete *.cpp.obj to external SRAM configure via FMC. Check the below .ld file for STM32F7 controller.
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K
EXT_SRAM_DATA (rw) : ORIGIN = 0x60000000, LENGTH = 256K
EXT_SRAM_MODULES (rw) : ORIGIN = 0x60040000, LENGTH = 256K
}
/* ========== Section for Buffers / Variables (up to 256KB) ========= */
.ext_sram_data :
{
. = ALIGN(8);
KEEP(*(.ext_sram_data))
KEEP(*(.ext_sram_data*))
. = ALIGN(8);
} > EXT_SRAM_DATA AT> FLASH
.ext_sram_modules :
{
. = ALIGN(8);
KEEP(*(testModule.cpp.obj))
. = ALIGN(8);
} >EXT_SRAM_MODULES AT> FLASH
After code compile, I can see the build details as
Memory region Used Size Region Size %age Used
RAM: 119928 B 512 KB 22.87%
FLASH: 246444 B 2 MB 11.75%
EXT_SRAM_DATA: 0 B 256 KB 0.00%
EXT_SRAM_MODULES: 0 B 256 KB 0.00%And .map file as below
.ext_sram_data 0x60000000 0x0 load address 0x0803c2ac
0x60000000 . = ALIGN (0x8)
*(.ext_sram_data)
*(.ext_sram_data*)
0x60000000 . = ALIGN (0x8)
.ext_sram_modules
0x60040000 0x0 load address 0x0803c2ac
0x60040000 . = ALIGN (0x8)
*(testModule.cpp.obj)
0x60040000 . = ALIGN (0x8)
I have tried to add uint8_t var[1024] global array in testModule.cpp but still I can see space has used from external SRAM.
So am I correctly using the feature to move complete object to external SRAM or if it is correct, where I can check that the space has been utilized?
Thanks,
Nitin
