2025-04-17 12:54 AM - last edited on 2025-04-17 2:08 AM by Andrew Neil
We are implementing a software-driven OTA update system using TouchGFX and a 64MB external QSPI flash. We store the following asset sections in QSPI:
ExtFlashSection
FontFlashSection
TextFlashSection
These are bundled into an ExternalFlash.bin asset file, which should be shared between firmware partitions (A/B). Since the data contains only static assets, it must remain bank-independent for OTA to work properly.
In the generated TypedTextDatabase.cpp, the following array is incorrectly marked with TEXT_LOCATION_FLASH_ATTRIBUTE:
TEXT_LOCATION_FLASH_PRAGMA
const touchgfx::TypedText::TypedTextData* const typedTextDatabaseArray[] TEXT_LOCATION_FLASH_ATTRIBUTE = {
typedText_database_GB,
typedText_database_ESP
};
This array is placed into TextFlashSection, which is part of ExternalFlash.bin. However, the array contains pointers to other flash-resident data (typedText_database_GB, etc.), which are already placed correctly in TextFlashSection.
Storing the array itself in flash causes absolute addresses to be written into ExternalFlash.bin, which ties it to the current firmware bank — defeating OTA partition independence.
This issue appears to be a code generation oversight, because in other sections (e.g., ExtFlashSection, FontFlashSection), the generated arrays do not use TEXT_LOCATION_FLASH_ATTRIBUTE. For example:
const touchgfx::Font* const fontList[] = {
&font_roboto_16_4bpp,
&font_roboto_24_4bpp
};
These arrays are placed in RAM, and only reference data located in external flash — which is the correct and expected behavior.
So, it's clear this is not a design choice, but a developer inconsistency in how typedTextDatabaseArray is handled.
Remove the TEXT_LOCATION_FLASH_ATTRIBUTE (and pragma) from the array declaration in TypedTextDatabase.cpp:
const touchgfx::TypedText::TypedTextData* const typedTextDatabaseArray[] = {
typedText_database_GB,
typedText_database_ESP
};
With this fix:
The array is stored in RAM (in firmware partition A or B)
It references data in external flash (QSPI-mapped)
The asset binary remains bank-independent
MCU: STM32F769NIHx
Board: STM32F769I-DISCO
TouchGFX Version: 4.24.2
External Flash: 64MB QSPI
Asset Sections Used: ExtFlashSection, FontFlashSection, TextFlashSection