2021-05-23 01:25 PM
Hello,
I have configured an External flash for the F412 chip. So I modified the STM32F412RETX_FLASH.ld like this:
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K
QUADSPI (r) : ORIGIN = 0x90000000, LENGTH = 4M
}
...
...
...
.ARM.attributes 0 : { *(.ARM.attributes) }
ExtFlashSection :
{
*(ExtFlashSection ExtFlashSection.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >QUADSPI
}
Configured the QSPi for the memory-mapped and assigned an array like this to the external flash:
#define LOCATION_EXTFLASH_ATTRIBUTE __attribute__ ((section ("ExtFlashSection"))) __attribute__ ((aligned(4)))
uint8_t logo_143x78_map[] LOCATION_EXTFLASH_ATTRIBUTE = {
/*Pixel format: Red: 5 bit, Green: 6 bit, Blue: 5 bit*/
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x30, 0x00, 0x40, 0x00, 0x58, 0x00, 0x70, 0x00, 0x88, 0x00, 0xa0, ........};
It works and I see the equipped memories like this:
However I see when I assign the data to the external memory, the RAM usage also descreases which I think it should not be like this, we have only changed the location of the data.
Is this normal?
Solved! Go to Solution.
2021-05-23 01:44 PM
Use "const"
2021-05-23 01:44 PM
Use "const"
2021-05-23 01:50 PM
That's it. Solved. Thanks.