cancel
Showing results for 
Search instead for 
Did you mean: 

Storing texts in external flash in TouchGFX 4.25

Matthew140801
Associate

Hi,

I've recently migrated to TouchGFX v4.25. The changelog seems to indicate that we can now store our texts in an unmapped external flash, for example an SPI flash. When going through the following page of the documentation :
https://support.touchgfx.com/docs/development/scenarios/fonts-in-unmapped-flash , it only mentions fonts and not the actual texts. Does the same principle apply to texts as well, or is it not possible to store texts in an unmapped SPI external flash ? Or am i not looking at the right documentation ?

 

Best regards,

4 REPLIES 4
LouisB
ST Employee

Hello @Matthew140801,
Yes you can, if they are converted as binary, then you can retrieve them by loading the data with the address where they are .

BR, 

Louis BOUDO
ST Software Engineer | TouchGFX

Thanks for the reply. If i use this approach, would the buffers used to read the data need to be large enough to contain the whole binary files ?In that case, it would imply having 12 KB and 14 KB buffers allocated in RAM, which would not be a convenient approach in my case.

The buffer should have the size of your data but you could also try to directly pass the address instead of loading it to the RAM.

Louis BOUDO
ST Software Engineer | TouchGFX

Hi @LouisB 

I believe this is no longer applicable in version 4.26.

According to the changelog:

"The generated typedTextDatabaseArray[], which might contain pointers to external flash, is now placed in internal flash by default."

Looking at the source code in TypedTextDatabase.cpp, this is indeed confirmed. The following declaration can be found:

TEXT_LOCATION_FLASH_PRAGMA
const touchgfx::TypedText::TypedTextData typedText_database_DEFAULT[] TEXT_LOCATION_FLASH_ATTRIBUTE = {
...
.
};

Where the macros are defined as:

/** A macro for placing Text kerning in memory. */
#define TEXT_LOCATION_FLASH_PRAGMA LOCATION_PRAGMA("TextFlashSection")
/** A macro for placing Text attribute in memory. */
#define TEXT_LOCATION_FLASH_ATTRIBUTE LOCATION_ATTRIBUTE("TextFlashSection")


This clearly shows that the typed text database is explicitly placed in the TextFlashSection.

There should be a call to TouchGFXDataReader::copyData that allows loading the Text from external flash, as is already done for Fonts and Images. One possible solution could be to modify the linker so that TextFlashSection is placed in RAM, and at TouchGFX startup manually load all the texts.