I can't save images on external Flash Memory correctly
Hi,
I have a custom board with STM32H7A3 using FMC, LLTC and other modules. I started to develop the firmware to change some images in a display. I made one project on TouchGFX with multiple images and fonts. I verify the BitmapDatabase.cpp and the all images files generated. For each image file generated for example:
LOCATION_PRAGMA("ExtFlashSection")
KEEP extern const unsigned char image_attention_all[] LOCATION_ATTRIBUTE("ExtFlashSection") = { // 223x265 RGB888 pixels.
0x0b, 0xba, 0xf7, 0x0b, 0xba, 0xf7, 0x0b, 0xba, 0xf7, 0x0b, 0xba, 0xf7,
...
...}In my application.ld file I put that configurations that I view on https://support.touchgfx.com/4.18/docs/development/scenarios/using-non-memory-mapped-flash
/* Specify the memory areas */
MEMORY
{
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 1024K
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
FLASH1 (rx) : ORIGIN = 0x8000000, LENGTH = 512K
FLASH2 (rx) : ORIGIN = 0x8100000, LENGTH = 512K
NOR1 (rx) : ORIGIN = 0x60000000, LENGTH = 64M /*External NOR Memory*/
SRAM (xrw) : ORIGIN = 0x62000000, LENGTH = 4M /*External SRAM Memory*/
}.ARM.attributes 0 : { *(.ARM.attributes) }
ExtFlashSection :
{
*(ExtFlashSection ExtFlashSection.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >NOR1
FontFlashSection :
{
*(FontFlashSection FontFlashSection.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >NOR1
TextFlashSection :
{
*(TextFlashSection TextFlashSection.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >NOR1When I try to build the program I have section output from compiler:
What I'm doing wrong?
I only can write some program inside NOR1 when I change part of linker like:
/*Original data without write anything on NOR
/* Constant data goes into FLASH
.rodata :
{
. = ALIGN(4);
*(.rodata) /* .rodata sections (constants, strings, etc.)
*(.rodata*) /* .rodata* sections (constants, strings, etc.)
. = ALIGN(4);
} >FLASH1
*/
/* Constant data goes into FLASH */
.rodata :
{
. = ALIGN(4);
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
. = ALIGN(4);
} >NOR1
What am I doing wrong? How can I have a sure that I write all images files in External Flash?
Best regards,
Luis Cristovao
