CubeMX + TouchGFX + CubeIDE integration with STM32F769I-Discovery - Flash Overflow?
- September 2, 2019
- 4 replies
- 2116 views
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 2I 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?
