Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE and TouchGFX 4.10.0: Resolving compilation issues

Chief III

Hi everyone,

I've removed the previous, textual guide. Instead, here's a video guide on how to get CubeIDE and TouchGFX working on an STM32F746G-DISCO board. I accidentally exported the video in 720p but have created a 1080p version. Leaving both links here because the 720p version may have useful comments and resolutions:



And here's the project i created and modified:

 (NOTE: This project does not have the modifications from our STM32F746G-DISCO/CubeMX article).

Best regards,


Associate II

Hi Martin, this your post is very precious, I'll try asap and I'll write a feedback for sure. Maybe some screenshots could be very helpful for better understandings 5/6/7 steps. THANKS!!!😉


Hi @Martin KJELDSEN​ ,

This tutorial worked for me! Only one thing that I needed to change was NOT excluding from build the OSWrappers.ccp, because if I exclude I get error generating .ELF file in touchgfx::OSWrappers::signalVSync() call.

So I included again and it worked!

Thanks for the tutorial.



Hi @eng23​,

Glad it helped. The reason for excluding the OSWrappers.cpp is because there may be two versions of it (+OSWrappers_cmsis.cpp). I guess you didn't have that one in your project? Maybe i'll update the guide to be more clear about this.


Hi @Martin KJELDSEN​ ,

I searched for this file but I don't have it, neither in cmsis files.



Okay, thanks for the feedback. This may only be available for boards where you can choose cmsis under OS.

Senior III

Sorry, I can't get this to work.

During step 3 when I should build my project I get the following:

20:41:04 **** Build of configuration Debug for project Test1 ****
make -j4 all 
arm-none-eabi-gcc -mcpu=cortex-m7 -g3 -c -x assembler-with-cpp --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -o "Startup/startup_stm32f746nghx.o" "../Startup/startup_stm32f746nghx.s"
arm-none-eabi-g++ "../Src/BoardConfiguration.cpp" -mcpu=cortex-m7 -std=gnu++14 -g3 -DUSE_HAL_DRIVER -DSTM32F746xx -DDEBUG -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../TouchGFX/gui/include -I../TouchGFX/generated/fonts/include -I../Drivers/CMSIS/Device/ST/STM32F7xx/Include -I../TouchGFX/generated/texts/include -I../Src -I../Drivers/STM32F7xx_HAL_Driver/Inc -I../TouchGFX/generated/images/include -I../Middlewares/ST/STM32_USB_Host_Library/Core/Inc -I../Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc -I../Inc -I../Drivers/CMSIS/Include -I../Middlewares/ST/TouchGFX/touchgfx/framework/include -I../TouchGFX/generated/gui_generated/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1 -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/STM32F7xx_HAL_Driver/Inc/Legacy -I../Middlewares/Third_Party/FatFs/src -O0 -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -fno-threadsafe-statics -fno-use-cxa-atexit -Wall -fstack-usage -MMD -MP -MF"Src/BoardConfiguration.d" -MT"Src/BoardConfiguration.o" --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -o "Src/BoardConfiguration.o"
arm-none-eabi-g++ "../Src/GPIO.cpp" -mcpu=cortex-m7 -std=gnu++14 -g3 -DUSE_HAL_DRIVER -DSTM32F746xx -DDEBUG -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../TouchGFX/gui/include -I../TouchGFX/generated/fonts/include -I../Drivers/CMSIS/Device/ST/STM32F7xx/Include -I../TouchGFX/generated/texts/include -I../Src -I../Drivers/STM32F7xx_HAL_Driver/Inc -I../TouchGFX/generated/images/include -I../Middlewares/ST/STM32_USB_Host_Library/Core/Inc -I../Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc -I../Inc -I../Drivers/CMSIS/Include -I../Middlewares/ST/TouchGFX/touchgfx/framework/include -I../TouchGFX/generated/gui_generated/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1 -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/STM32F7xx_HAL_Driver/Inc/Legacy -I../Middlewares/Third_Party/FatFs/src -O0 -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -fno-threadsafe-statics -fno-use-cxa-atexit -Wall -fstack-usage -MMD -MP -MF"Src/GPIO.d" -MT"Src/GPIO.o" --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -o "Src/GPIO.o"
arm-none-eabi-g++ "../Src/HW_Init.cpp" -mcpu=cortex-m7 -std=gnu++14 -g3 -DUSE_HAL_DRIVER -DSTM32F746xx -DDEBUG -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../TouchGFX/gui/include -I../TouchGFX/generated/fonts/include -I../Drivers/CMSIS/Device/ST/STM32F7xx/Include -I../TouchGFX/generated/texts/include -I../Src -I../Drivers/STM32F7xx_HAL_Driver/Inc -I../TouchGFX/generated/images/include -I../Middlewares/ST/STM32_USB_Host_Library/Core/Inc -I../Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc -I../Inc -I../Drivers/CMSIS/Include -I../Middlewares/ST/TouchGFX/touchgfx/framework/include -I../TouchGFX/generated/gui_generated/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1 -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/STM32F7xx_HAL_Driver/Inc/Legacy -I../Middlewares/Third_Party/FatFs/src -O0 -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -fno-threadsafe-statics -fno-use-cxa-atexit -Wall -fstack-usage -MMD -MP -MF"Src/HW_Init.d" -MT"Src/HW_Init.o" --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -o "Src/HW_Init.o"
../Src/GPIO.cpp:2:10: fatal error: touchgfx/hal/GPIO.hpp: No such file or directory
 #include <touchgfx/hal/GPIO.hpp>
compilation terminated.
../Src/BoardConfiguration.cpp:1:10: fatal error: common/TouchGFXInit.hpp: No such file or directory
 #include <common/TouchGFXInit.hpp>
compilation terminated.
make: *** [Src/ Src/GPIO.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Src/ Src/BoardConfiguration.o] Error 1

Another note on that step:

Shouldn't you make sure that the LCD RESET Pin XRES is tied to PI12 [LCD_DISP...] ?


In step 3 you will have errors because touchgfx files are not generated at this moment, you must execute until step 7 to compile without errors.

About the reset pint question you are right, is necessary to set this. You can follow this other tutorial about CubeMX settings, because there are others like QUADSPI, LTDC...


Exactly what @eng23​ is saying. It can be a bit difficult to understand the flow, especially since CubeIDE is a more generic solution than CubeMX. being Eclipse based. Until you configure TouchGFX as the graphics middleware and build+generate, there will be no touchgfx files at all present in the right places - These are generated through the CubeMX module.


Still no luck.

I thought that the first post was the complete guide on how to do things.

I tried to follow the guide guide with setting up the QSPI and Graphics. Should I let the Cube generate code at that point?

in step 5 you write 'Could be worked around' - do you mean 'Could' as in it could be or as in it should be worked around?

Step 6 is hard for me to follow. Is it enough just to rightclick on the folder structure and select exlude from library? Is it strictly necessary or would the project be able to build regardless?

I know you guys are working hard to get this more automated. Is there a public timeframe for this?