cancel
Showing results for 
Search instead for 
Did you mean: 

Does CubeMX 5.0.0 Ready to Build a TouchGFX Project?

Zhi Pang
Associate III

I upgraded my CubeMX to 5.0.0 and installed F4 1.22.0 firmware recently.

So, I tried to use CubeMX build a TouchGFX Project that use TrueSTUDIO as IDE.Since I was successful run a STemWin Project as my custom F429IGx board graphic solution.

In order to enable TouchGFX middleware in CubeMX, I activated and configured FreeRTOS, CRC, LTDC, DMA2D, TIM7 and FMC-SDRAM1.All setting were the same with my previous STemWin project, excepted in GRAPHICS I used TouchGFX as Graphics Framework. And then I generated code.

1. When opened the project, there were *.c , *.cpp , *.h and *.hpp files. But in C/C++ Build - Tool Setting , neither C++ Compiler and C++ Linker existed. So if I build the project under this settings, I will get a link error say something like main function undefined. Because main function is in main.cpp file and wound't be compile by GCC like other cpp files.

2. So I converted the project to C++ project, by using File - New - Convert to a C/C++ Project (Adds C/C++ nature) method. Now the C++ Compiler showed up and C++ Linker replaced C Linker.I built the project again, but a ton of error message like head files couldn't find show up. I fixed by copied and changed include path from C compiler directories to C++ compiler.But things not go well,some directories in Project Resources Manager's Includes still in grey which implicate those directories did not exist in that location.

3. Then I use TouchGFX Designer to generated a simple project which is only contains a single screen of a text and a background image.After code generation, I put the entire folder in TrueSTUDIO project's root. Now the "Includes" didn't has grey directories any more.I dragged all the cpp files which is generated by TouchGFX Designer into TrueSTUDIO project path [Application-User-TouchGFX-generated|gui].Things going in here is a bit out of my ability, since I am new in TouchGFX and new in mixin C(GCC) and C++(G++) code together.

4. I tried out lots of combination of Assembler, C Complier, C++ Complier, C++ Linker settings which mention in TouchGFX website.I can't describe all of them.The best result I can get is all c files compile into *.o successfully by GCC and all C++ files compile into *.o successfully by G++, but when executed

arm-atollic-eabi-g++ -o LC-MC001.elf *.o ...

command,which as we know is linking, tons of error show up.

d:/program files (x86)/atollic/truestudio for stm32 9.0.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: error: LC-MC001.elf uses VFP register arguments, Application\User\Core\main.o does not
d:/program files (x86)/atollic/truestudio for stm32 9.0.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: failed to merge target specific data of file Application\User\Core\main.o
d:/program files (x86)/atollic/truestudio for stm32 9.0.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: error: LC-MC001.elf uses VFP register arguments, Application\User\TouchGFX\generated\ApplicationFontProvider.o does not
d:/program files (x86)/atollic/truestudio for stm32 9.0.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: failed to merge target specific data of file Application\User\TouchGFX\generated\ApplicationFontProvider.o
...

5. The last information about this I can find is related to floating point implementation? I already tried to switch all implementation to HW or SW the same time.But no luck.

UPDATE

6. I switch Assembler, C compiler, C++ compiler, C++ Linker floating point option to Hardware implementation.And remove -mfloat-abi=softfp parameter which is recommend by this article:

https://touchgfx.zendesk.com/hc/en-us/articles/206116381-Using-other-IDEs-with-TouchGFX

So, after that, all of the processor will have a united floating point setting. Then put SysTick_Handler function back into stm32f4xx_it.c file. Finally, my project build without any error for the first time.

7. I download the program in my board. Sadly, I got this.0690X000006CSy2QAG.jpg

 And my original design is below.

0690X000006CSy7QAG.jpg

I will keep you update if any further information.

Thanks for your reading, I know it's a very long problem description.:face_with_tears_of_joy:

58 REPLIES 58
Nawres GHARBI
ST Employee

Hi @Zhi Pang​ ,

After some investigations, it seems that there are some generation problems when using TrueStudio and TouchGFX.

I advice to switch to SW4STM32 until this issue is fixed.

We are sorry for the disturbance this issue may bring.

Clark Sann
Senior

I just tried to build a TouchGFX project for STM32F746-DISCO using SW4STM32. I followed the instructions of the tutorial as best as I could. I created a new simple GUI rather than importing an older TouchGFX GUI. Unfortunately it didn't build either.

I encountered the following error: C:/Users/Administrator/workspace/SW4STM32_TouchGFX_Test/Middlewares/ST/TouchGFX/touchgfx/framework/include/platform/hal/simulator/sdl2/HALSDL2.hpp:22:10: fatal error: SDL2/SDL_video.h: No such file or directory

 #include <SDL2/SDL_video.h>

I have attached my project file. Please let me know if I made and error in creating the project.

Nawres GHARBI
ST Employee

Hi @Clark Sann​ 

This is a GCC IDE constraint that doesn't accept long paths.

Try to get a shorter path for your project

As a test you can replace the "SDL2" folder under your include generated by STM32CubeMX

Clark Sann
Senior

@Nawres GHARBI​ 

The path to the missing file (SDL2/SDL_video.h) is C:\Users\Administrator\workspace\Test\Middlewares\ST\TouchGFX\touchgfx\framework\include\platform\hal\simulator\sdl2\vendor\SDL2

That path is only 128 bytes. Isn't the windows limit 260 bytes?

I think the problem is that CubeMX did not put the correct include paths into the SW4STM32 project. When I add the above path to the list of include paths, the compiler is able to find the missing file.

However it still doesn't build because it then can't find <shellapi.h>. I can't fix this since this file is not included by CubeMX.

Nawres GHARBI
ST Employee

Hi @Clark Sann​ 

I moved all the SDL folder under include folder generated by STM32CubeMX and it compiles ok, How did you from your side.

For the Shellapi.h, as you generated an under root project all the files have been added to the project even if not needed.

Shellapi.h stands for a library used by windows to build interfaces on the simulator.

To avoid this issue please remove all the simulator generated files from the projects

Clark Sann
Senior

@Nawres GHARBI​ 

I don't think the problem is with a long path. I was able to include the SDL2 folder by adding this path

"Middlewares/ST/TouchGFX/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/"

to the Project Properties -> C/C++ General -> Paths and Symbols. This keeps me from having to change the Middlewares/St/TouchGFX path structure.

I then deleted MyProject/TouchGFX/simulator. I found I could not delete other simulator folders located in Middleware/ST/TouchGFX because those files were needed for compilation of other non-simulator related files.

When I build now I get a LOT of errors. I will include my project.

Since you are able to get a project to build by relocating the SDL (or did you mean SDL2 folder?), please provide me more details on what you did. And also please tell me exactly what simulator generated files you deleted.

Thank you Nawres for your help. I feel I am close to being able to build my TouchGFX project. I have been trying to get it done for months.

PPiar
Associate II

I have same issues with project generated by CubeMX 5.0 for STM32F746 discovery board. IAR project compiles just fine, but TrueStudio's isn't.

Once I'm adding TouchGfx into project, project must be manually converted from C to C++, all sorts of undefined symbols and simulator code which I think should be excluded from build. After few days of kung fu with TrueStudio, I gave up.

PPiar
Associate II

on the other hand, STM32 Workbench project compiled almost out of box: I had to manually exclude source files for simulator from compilation:

Middlewares\ST\TouchGFX\touchgfx\framework\source\platform\hal\simulator\sdl2\*.cpp

TouchGFX\simulator\*.*

Clark Sann
Senior

@PPiar​ 

For some reason, when I do what you suggested, I still cannot build. Here is exactly what I am doing:

  1. Use CubeMX to create a TouchGFX project using SW3STM32.
  2. In CubeMX, click the Execute button, and use TouchGFX Designer to create a simple GUI with a couple buttons and a couple sliders.
  3. Close CubeMX and open SW4STM32.
  4. In the Project Explorer, navigate to Project->TouchGFX->simulator. Right click the simulator folder, select Resource Configurations->Exclude from Build. The folder and all of its contents are grayed out and the icon has a slash through it.
  5. In the Project Explorer, navigate to Project->Middlewares->ST->TouchGFX->touchgfx->framework->source->platform->hal->simulator->sdl2. Right click the simulator folder, select Resource Configurations->Exclude from Build. The folder and all of its contents are grayed out and the icon has a slash through it.
  6. Build and get the following error: C:/Users/Administrator/workspace/Test_SW4STM33/Middlewares/ST/TouchGFX/touchgfx/framework/include/platform/hal/simulator/sdl2/HALSDL2.hpp:22:10: fatal error: SDL2/SDL_video.h: No such file or directory #include <SDL2/SDL_video.h>. This is apparently caused because the project does not have the SDL2 folder in the include path.
  7. Add the following to the include path in Project Properties->C/C++ Build->Paths and Symbols-> CNU C++->Includes: Middlewares\ST\TouchGFX\touchgfx\framework\include\platform\hal\simulator\sdl2\vendor\
  8. Rebuild. This time the compiler finds the missing files but still produces this error:

Building file: ../Middlewares/ST/TouchGFX/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.cpp

Invoking: MCU G++ Compiler

C:\Users\Administrator\workspace\Test_SW4STM33\Debug

arm-none-eabi-g++ -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 '-D__weak=__attribute__((weak))' '-D__packed=__attribute__((__packed__))' -DUSE_HAL_DRIVER -DSTM32F746xx '-DUSE_BPP=16' -I"C:/Users/Administrator/workspace/Test_SW4STM33/FATFS/Target" -I"C:/Users/Administrator/workspace/Test_SW4STM33/FATFS/App" -I"C:/Users/Administrator/workspace/Test_SW4STM33/Core/Inc" -I"C:/Users/Administrator/workspace/Test_SW4STM33/TouchGFX/target" -I"C:/Users/Administrator/workspace/Test_SW4STM33/USB_HOST/App" -I"C:/Users/Administrator/workspace/Test_SW4STM33/USB_HOST/Target" -I"C:/Users/Administrator/workspace/Test_SW4STM33/TouchGFX/generated/fonts/include" -I"C:/Users/Administrator/workspace/Test_SW4STM33/TouchGFX/generated/texts/include" -I"C:/Users/Administrator/workspace/Test_SW4STM33/TouchGFX/generated/images/include" -I"C:/Users/Administrator/workspace/Test_SW4STM33/TouchGFX/generated/gui_generated/include" -I"C:/Users/Administrator/workspace/Test_SW4STM33/TouchGFX/gui/include" -I"C:/Users/Administrator/workspace/Test_SW4STM33/Middlewares/ST/TouchGFX/touchgfx/framework/include" -I"C:/Users/Administrator/workspace/Test_SW4STM33/Drivers/STM32F7xx_HAL_Driver/Inc" -I"C:/Users/Administrator/workspace/Test_SW4STM33/Drivers/STM32F7xx_HAL_Driver/Inc/Legacy" -I"C:/Users/Administrator/workspace/Test_SW4STM33/Middlewares/Third_Party/FatFs/src" -I"C:/Users/Administrator/workspace/Test_SW4STM33/Middlewares/Third_Party/FreeRTOS/Source/include" -I"C:/Users/Administrator/workspace/Test_SW4STM33/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS" -I"C:/Users/Administrator/workspace/Test_SW4STM33/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1" -I"C:/Users/Administrator/workspace/Test_SW4STM33/Middlewares/ST/STM32_USB_Host_Library/Core/Inc" -I"C:/Users/Administrator/workspace/Test_SW4STM33/Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc" -I"C:/Users/Administrator/workspace/Test_SW4STM33/Drivers/CMSIS/Device/ST/STM32F7xx/Include" -I"C:/Users/Administrator/workspace/Test_SW4STM33/Drivers/CMSIS/Include" -I"C:/Users/Administrator/workspace/Test_SW4STM33/Middlewares/ST/TouchGFX/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor" -Og -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fno-exceptions -fno-rtti -MMD -MP -MF"Middlewares/ST/TouchGFX/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.d" -MT"Middlewares/ST/TouchGFX/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.o" -o "Middlewares/ST/TouchGFX/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.o" "../Middlewares/ST/TouchGFX/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.cpp"

In file included from C:/Users/Administrator/workspace/Test_SW4STM33/Middlewares/ST/TouchGFX/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_video.h:31:0,

         from C:/Users/Administrator/workspace/Test_SW4STM33/Middlewares/ST/TouchGFX/touchgfx/framework/include/platform/hal/simulator/sdl2/HALSDL2.hpp:22,

         from ../Middlewares/ST/TouchGFX/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.cpp:17:

C:/Users/Administrator/workspace/Test_SW4STM33/Middlewares/ST/TouchGFX/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_stdinc.h:261:50: error: size of array 'SDL_dummy_enum' is negative

    typedef int SDL_dummy_ ## name[(x) * 2 - 1]

                         ^

C:/Users/Administrator/workspace/Test_SW4STM33/Middlewares/ST/TouchGFX/touchgfx/framework/include/platform/hal/simulator/sdl2/vendor/SDL2/SDL_stdinc.h:290:1: note: in expansion of macro 'SDL_COMPILE_TIME_ASSERT'

 SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));

 ^~~~~~~~~~~~~~~~~~~~~~~

Middlewares/ST/TouchGFX/touchgfx/framework/source/platform/driver/touch/subdir.mk:21: recipe for target 'Middlewares/ST/TouchGFX/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.o' failed

make: *** [Middlewares/ST/TouchGFX/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.o] Error 1

I have no idea how to fix this error.

Was your compiler able to find a path to the SDL2 folder? Do you have any ideas why you are able to build your project and I cannot build mine?

Thank you in advance for any further help you can provide!

exclude file platform/driver/touch/SDL2TouchController.cpp from compilation