2023-04-17 03:18 PM
Hi, i'm using STM32H750VB and it has 128kB embedded flash, so i'm using an external 16MB qspi flash. When i'm trying to fit firmware to internal & external flash, i modified linker script like this: base hal libraries are located in internal flash and touchgfx libs/gui desingn binaries located in qpsi flash. In this configuration i get hard fault because when initializing __libc_init_array lib, its trying to load binaries from qpsi address space.
How to figure out this problem?
2023-04-17 06:03 PM
>>How to figure out this problem?
Add code in SystemInit() that's capable of bringing up the external memory before using it via the constructors, etc.
You could make a loader that lives in the Internal Flash, have that bring up the clocks, SDRAM, QSPI, etc, and then put all the app code in QSPI and transfer control to it once you've brough the system up.
2023-04-18 12:47 AM
hello, how did you edit the STM32xxx_FLASH.ld file?
2023-04-18 01:03 AM
I have add a section called TGFX_TEXT before all other sections and include all of touchgfx files in it. Like this;
SECTIONS
{
.TGFX_TEXT :
{
. = ALIGN(4);
*libtouchgfx-float-abi-hard.a:*(.text .text.*)
*TouchGFX/App/*.o(.text .text.*)
*TouchGFX/generated/fonts/src/*.o(.text .text.*)
*TouchGFX/generated/gui_generated/src/common/*.o(.text .text.*)
*TouchGFX/generated/gui_generated/src/mainscreen_screen/*.o(.text .text.*)
*TouchGFX/generated/images/src/*.o(.text .text.*)
*TouchGFX/generated/images/src/__generated/*.o(.text .text.*)
*TouchGFX/generated/texts/src/*.o(.text .text.*)
*TouchGFX/gui/src/common/*.o(.text .text.*)
*TouchGFX/gui/src/main_screen/*.o(.text .text.*)
*TouchGFX/gui/src/model/*.o(.text .text.*)
*TouchGFX/target/*.o(.text .text.*)
*TouchGFX/target/generated/*.o(.text .text.*)
. = ALIGN(4);
} >QSPI
/* The startup code goes first into FLASH */
.isr_vector :
{
...
2023-04-18 01:19 AM
You mean write external flash lib and stm32 qspi configurator functions in register based format and call it from SystemInit? This is very tedious and irregular programming. Isn't there a shortcut?
I have already done with emWin gui lib but it's not working touchgfx :(
2023-04-18 01:29 AM
I in my projects am using STM32H7B0VBT6 which has 128K internal flash. I created a boot that runs in the internal flash and jumps to the application which instead resides in the external flash together with all the Touchgfx graphic resources (bitmaps, texts and fonts).
I confirm that you need an external charger suitable for your external memory model.
2023-04-18 02:08 AM
You mean split project in two pieces, one of is qspi bootloader and the other one is gui application, am i right? If i do it this way i can't do debug :(
2023-04-18 02:21 AM
follow this guide and you will be able to use debug even if the program runs on the external flash:
2023-04-19 02:27 AM
I tried this about 2 years ago and it failed. I will check out this guide, thanks for reply.