How to configure project to use external flash vs internal flash for TouchGFX assets? I have 2 basic screens that work fine with internal flash but does not display with assets loaded into external flash.
Here are the memory assets when I have the project configured for internal flash...
and here is how the linker script is configured of course..
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 2048K - 128K
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
EXTFLASH (r) : ORIGIN = 0x90000000, LENGTH = 8M
}
FontFlashSection :
{
*(FontFlashSection FontFlashSection.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >FLASH
TextFlashSection :
{
*(TextFlashSection TextFlashSection.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >FLASH
ExtFlashSection :
{
*(ExtFlashSection ExtFlashSection.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >FLASH
Now I just changed these sections to EXTFLASH, and added the code to enable memory mapped mode for the QSPI of the NORFlash that contains the assets.
FontFlashSection :
{
*(FontFlashSection FontFlashSection.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >EXTFLASH
TextFlashSection :
{
*(TextFlashSection TextFlashSection.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >EXTFLASH
ExtFlashSection :
{
*(ExtFlashSection ExtFlashSection.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >EXTFLASH
In main.c after the STM generated initializations...
/* USER CODE BEGIN 2 */
if (CSP_QUADSPI_Init() != HAL_OK) {
Error_Handler();
}
if (CSP_QSPI_EnableMemoryMappedMode() != HAL_OK) {
Error_Handler();
}
HAL_NVIC_DisableIRQ(QUADSPI_IRQn);
Then I see the memory usage change to this as expected.
However, this does work...when I debug the application it seems to go to hard fault from the touchgfx_init....
Any ideas as to what may be going on here? Not aware of anything else that must be setup in TouchGFX when using external memory, the image configuration in TouchGFX is already set to ExtFlashSection.
