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.😂

58 REPLIES 58
Zhi Pang
Associate III

Hi @Nawres GHARBI​ ,

I'm no sure which step is wrong. Now I post every step I did and won't miss any detail. And hope it will help.

1 Start a new project with STM32F429IGTx.

0690X000006CUrhQAG.jpg

2 Check the conditions that need to be enabled.

0690X000006CUrrQAG.jpg

3 Enabled FreeRTOS and Enabled Config parameters - USE_APPLICATION_TASK_TAG.

0690X000006CUrwQAG.jpg

4 Activated DMA2D and configure Parameter Settings.

0690X000006CUs1QAG.jpg5 Activated CRC.

0690X000006CUs6QAG.jpg6 Turn on FMC - SDRAM1, and configure settings base on my SDRAM Chip.

0690X000006CUsGQAW.jpg

7 Turn on TIM1 and leave the settings by default.

0690X000006CUsLQAW.jpg

8 Turn on LTDC and configure layer 0 - pixel format to RGB565. Leave Parameter Settings by default.

0690X000006CUsaQAG.jpg

9 Select TouchGFX as the Graphics Framework. Select LTDC as the Display Interface. Select the path of TouchGFX Designer 4.10.0 .

0690X000006CUsfQAG.jpg

10 Manage the clock configuration.

0690X000006CUskQAG.jpg

Clark Sann
Senior

Hello @Zhi Pang​ 

I notice in your step 9, the Execute button is disabled. What are you doing to enable it?

Here is what I do:

Step 11. Fill in the Project Manager

Step 12. Click "Generate Code". At the end of generate code, press cancel. The button now is enabled.

Step 13. Click Execute. Use the Designer to design my GUI. I have not found any way to use a previously created GUI.

Step 14. Test GUI with simulator. Build code. Exit designer.

Step 14. Click "Generate Code" again and open TrueStudio or other development environment.

Step 15. Build and look at all the errors.

This is a weird procedure. I wish the tutorial was more helpful. It doesn't discuss how to get the Execute button to be enabled. Maybe there is a better way.

Zhi Pang
Associate III

Continue... @Nawres GHARBI​ 

11 Enter a project name and select TrueSTUDIO as the Toolchain / IDE. Leave other settings in Project Manager by default.

0690X000006CUspQAG.jpg

12 Set the debug type and Timebase Source in SYS.

0690X000006CUsuQAG.jpg

13 Click GENERATE CODE button and ignore the warning.

0690X000006CUszQAG.jpg

14 Waiting for the generating process complete the choose close.

0690X000006CUt4QAG.jpg

15 Click the Execute button to open TouchGFX Designer since it can be use after code generation.

0690X000006CUt9QAG.jpg 16 Drag a image and type a text in the TouchGFX Designer.

0690X000006CUtEQAW.jpg17 Clicke the Generate Code Button in the TouchGFX Designer. And then the status bar mention the process is complete.0690X000006CUtJQAW.jpg18 Open the Project file.

0690X000006CUtOQAW.jpg

19 Try to build the project. And the same error shows.

0690X000006CUtTQAW.jpg

20 The C++ Compiler and C++ Linker didn't come out.

0690X000006CUtYQAW.jpg

The whole project and screen shot are attached.

Hi @Clark Sann​ 

Please check my continued post.

Hi @Zhi Pang​ 

Did you open the TouchGFX designer and generate the graphic project ?

Hi @Nawres GHARBI​ 

Yes, I did. I described these steps in this post step-15 to step-17.

You can see the screen shots.

Thomas Borowczak
ST Employee

​Hi @Zhi Pang​ 

This getting started document should answer your initial question "Does CubeMX 5.0.0 Ready to Build a TouchGFX Project?" :

https://touchgfx.zendesk.com/hc/en-us/articles/360020001492-Getting-Started-with-CubeMX-and-TouchGFX

Hope this helps

urvil.suthar
Associate

Errors while compiling in file HALSDL2.c file, error generated for functions which are not present in the project folder:

..\Middlewares\ST\TouchGFX\touchgfx\framework\source\platform\hal\simulator\sdl2\HALSDL2.cpp:963:28: error: 'OpenClipboard' was not declared in this scope

    if (!OpenClipboard(NULL))

                           ^

..\Middlewares\ST\TouchGFX\touchgfx\framework\source\platform\hal\simulator\sdl2\HALSDL2.cpp:969:25: error: 'EmptyClipboard' was not declared in this scope

    if (!EmptyClipboard())

                        ^

many more in same file ...

I am sure, i made some mistake, but now i can't find out where it is.. (Followed the steps given by "Zhi Pang" the only change is, selected the board STM32F746G-Disco).

Clark Sann
Senior

@BacteriusOROWCZAK​ I am using a STM32F746-DISCO board and SW4STM32. The STM32F746-DISCO portion of the article is only for IAR and I couldn't figure out how to make the instructions work for SW4STM32. Do you plan to make a version of the article for SW4STM32?

Hi @BacteriusOROWCZAK​ 

I read that document "Getting Started with CubeMX and TouchGFX

".The document mentioned two entry points, TouchGFX Designer and CubeMX. Since I don't have any ST's Discovery or Evaluation board, I wound like to use CubeMX with MCU Selector.

I have a PCB which include a STM32F429IGTx,a LCD display use RGB565 interface, a capacity touch screen use IIC interface, a 32 MBytes SDRAM. I can confirm this hardware solution can fulfill the graphic requirement. Because I successfully built the project with STemWin and display the content.

The first problem I met is that the code which is generated by CubeMX ​contain cpp files but TrueSTUDIO can't compile them.

The document doesn't cover information about use TrueSTUDIO as a toolchain, but only mention MDK-ARM and IAR EWARM. So I don't know which step I took is wrong.