cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX + TouchGFX + CubeIDE integration with STM32F769I-Discovery - Flash Overflow?

Mason_Yu
Associate

I have spent the past week or so trying to get a project configured starting from CubeMX with TouchGFX on the STM32F769I-DISCO board. I followed these guides below for CubeMX configuration and troubleshooting the compilation issues that came up:

https://touchgfx.zendesk.com/hc/en-us/articles/360020208091-Configuring-STM32F769I-DISCO

https://www.youtube.com/watch?v=VOs2LYO7wSA&feature=youtu.be

After excluding the simulator files from compilation, I ran into another issue with flash overflow. The last portion of the console error message from the latest version of CubeIDE is shown below:

arm-none-eabi-g++ -o "TGFXtest.elf" @"objects.list" -l:libtouchgfx-float-abi-hard.a -mcpu=cortex-m7 -T"C:\Users\stone\STM32CubeIDE\workspace_1.0.2\TGFXtest\STM32F769NIHX_FLASH.ld" --specs=nosys.specs -Wl,-Map="TGFXtest.map" -Wl,--gc-sections -static -L../Middlewares/ST/TouchGFX/touchgfx/lib/core/cortex_m7/gcc --specs=nano.specs -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -lstdc++ -lsupc++ -Wl,--end-group
 
c:\st\stm32cubeide_1.0.2\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe: TGFXtest.elf section `ExtFlashSection' will not fit in region `FLASH'
 
c:\st\stm32cubeide_1.0.2\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe: region `FLASH' overflowed by 1556192 bytes
 
collect2.exe: error: ld returned 1 exit status
 
make: *** [makefile:94: TGFXtest.elf] Error 1
 
"make -j8 all" terminated with exit code 2. Build might be incomplete.
 
 
 
22:19:05 Build Failed. 1 errors, 1 warnings. (took 1m:40s.913ms)

The TouchGFX test GUI used was extremely simple, basically a copy of what Martin Kjeldsen showed in his video, so it shouldn't be very large in size. I think this issue might be due to the need to modify BSP linker scripts and allocate region for QSPI Flash. I'm really not quite sure how to do this (or if it is needed at all) in CubeIDE, because the help desk guide linked above only gave instruction on modifying a EWARM project. Since there's also a possibility that something was configured incorrectly in CubeMX, I have attached my .ioc file below for reference.

In a separate attempt to generate a working project, I tried to start from TouchGFX designer, create the same test GUI and flash to the board using the "Run Target" button. This worked with no problem. Then I tried to start from the .ioc file created by the TGFX Template for the STM32F769I Discovery board. But after generating code in CubeMX and importing the project into CubeIDE, I had to resolve a bunch of compilation and file linking errors, including those related to simulator files, linking of header files and touch driver codes. 3 hours of my life down the drain later, I finally gave up when I saw a wall of errors related to CMSIS driver code.

This process also broke compilation in TouchGFX Designer by the way, resulting in the following error:

In file included from Core/Src/main.cpp:53:0:
 
Core/Src/main.cpp: In function 'int main()':
 
Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h:470:54: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
 
 { #name, (thread), (priority), (instances), (stacksz)}
 
                           ^
 
Core/Src/main.cpp:174:3: note: in expansion of macro 'osThreadDef'
 
  osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 4096);
 
  ^~~~~~~~~~~
 
Compiling TouchGFX/target/HW_Init.cpp
 
Compiling TouchGFX/target/BoardConfiguration.cpp
 
Compiling Middlewares/Third_Party/FreeRTOS/Source/croutine.c
 
Compiling Middlewares/Third_Party/FreeRTOS/Source/list.c
 
Compiling Middlewares/Third_Party/FreeRTOS/Source/queue.c
 
make[2]: *** No rule to make target 'Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_2.c', needed by 'TouchGFX/build/ST/STM32F769I-DISCO/Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_2.o'. Stop.
 
make[2]: *** Waiting for unfinished jobs....
 
Compiling Middlewares/Third_Party/FreeRTOS/Source/tasks.c
 
Compiling Middlewares/Third_Party/FreeRTOS/Source/timers.c
 
gcc/Makefile:326: recipe for target 'generate_assets' failed
 
make[1]: *** [generate_assets] Error 2
 
../gcc/Makefile:45: recipe for target 'all' failed
 
make: *** [all] Error 2

I sincerely hope these integration issues can be resolved soon because it looks like the problems have been there for quite a few months and obviously not unique to one discovery board. For the near future, I will resort to manually editing the working project generated by the Template in TGFX Designer since it is currently the only way for me to have a working TGFX project compiled and flashed to the board. Losing CubeMX and CubeIDE for my project is going to be a big blow though...

I would appreciate if a few more integration guide can be published too, even an expansion and clarification of the Help Desk guide would be very useful. Can anyone offer some help to solve my issues outlined above?

4 REPLIES 4
Martin KJELDSEN
Chief III

I sound like a broken record at this point.

We're working on improving the integration. It has HIGH priority here (a long with everything else that also has HIGH priority). There are a lot of actors in play when it comes to making sure that all parts of the tool chain integrate well and play nice.

I'm going to try to get an over over the current issues the community is having. Both the CubeIDE and CubeMX team are working on, and have fixed issues, that we've reported based on your and our own inputs.

A new style of documentation for this is also in the pipeline, but there's a ton of work to do so i can't do more than ask for patience. I know that's a tall order when there's projects to do and deadlines to be met, but it's the best i can do. Just trust me when i say it has priority and is being worked on actively, but progress is a bit slow due to various factors.

/Martin

BPark.3
Associate II

Had a similar issue with flash overflow, in my case it was an issue of QSPI not being used and images were being stored directly in flash, make sure you have added QSPI like in this thread: https://community.st.com/s/question/0D50X0000AIeS5CSQV/stm32cubemx-touchgfx-atollic-how-to-setup-the-qspi-external-flash-

Ben

BPark.3
Associate II
JJhin.1
Senior II

After Doing all of the suggetion given above... still i was getting Flash over flow errors.... then i checked my CubeMX Configuration throughly and found that ... In touchGFx middelware section , i have selected Buffer location as "By allocation" ..... So i changed it and selected "By address" so my errors gone.


_legacyfs_online_stmicro_images_0693W00000blC9vQAE.pngno errors coming when im not using any background image ... but when im adding background image ... im getting flash over flow error again...