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

Hey Nick

By excluding the files you list, I have finally built and flashed my first TouchGFX project using SW4STM32. THANK YOU! That is awesome. I've been trying for months to get SW4STM32 to build a TouchGFX project. Thank you again.

I do have one problem though. My GUI appears on the screen but then the screen freezes. None of the buttons or sliders work at all.

I'm having trouble tracing this app, but it appears to me that the program dies inside of main.cpp at the call to GRAPHICS_Init(). I get to a breakpoint at that point, but when I start after reaching that breakpoint, I do not get to the next statement which is osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 4096);

And I do not ever seem to reach touchgfx::touchgfx_init() which is the very next statement called when GRAPHICS_Init is called. That makes no sense. I wonder if tracing is working right.

Try splitting it off into two tasks. It helped me to get another task to get some time. Also, I'm running gui task with normal priority.

Also, touch screen is not initialized by default, I'm still figuring out how to but should be easy to pull this part from another example

/* USER CODE BEGIN 4 */
void StartGuiTask(void const * argument)
{
  /* Graphic application */
    GRAPHICS_MainTask();
}
/* USER CODE END 4 */
 
/* USER CODE BEGIN Header_StartDefaultTask */
/**
  * @brief  Function implementing the defaultTask thread.
  * @param  argument: Not used 
  * @retval None
  */
/* USER CODE END Header_StartDefaultTask */
void StartDefaultTask(void const * argument)
{
  /* init code for FATFS */
  MX_FATFS_Init();
 
  /* init code for LIBJPEG */
  MX_LIBJPEG_Init();
 
  /* USER CODE BEGIN 5 */
  /* Infinite loop */
  for(;;)
  {
      HAL_GPIO_WritePin(GPIOI, ARDUINO_D7_Pin, GPIO_PIN_RESET);
      osDelay(500);
      HAL_GPIO_WritePin(GPIOI, ARDUINO_D7_Pin, GPIO_PIN_SET);
      osDelay(500);
  }
  /* USER CODE END 5 */ 
}

Clark Sann
Senior

I decided to reconfigure my project in CubeMX. I found that ST has restructured the files and the simulator files are now gone. So there is no need to exclude any files at all. In SW4STM32, the project builds as soon as I add a few files I need.

I did find that the user include directory is now hidden from Eclipse. Not sure I like that very much. It was awkward to put my include file into the hidden directory. I couldn't find any way to do that within Eclipse. If anyone knows how to do that, please add a comment.

When I run the project on the STM32F756G-DISCO, it puts up the proper GUI and then freezes. I'm not sure yet whether this is due to a problem with FreeRTOS or with the TouchController.

PPiar
Associate II

overall, this is sooo unreliable! I was changing something related to touch screen code, and whole project went into lala land.. First, LCD started displaying garbage. No idea what I have done, but after 10-15 attempts manually clean up object files on HDD and rebuild, I finally seeing reasonable colors on LCD, but nowhere close to actual GUI I'm seeing in Designer.

Another clean up for generated gui files and linker can't find references to touchgfx core functionality..

where is re-build all button in Designer?

why after restarting designer, resources loosing text values? why typography resets to default settings, not what I changed?

this is so painful to waste so much time on nothing, really

I think I had the same thing happen. I had a working GUI on my 746G-DISCO. I was trying to get FreeRTOS working, and I started getting garbled GUI. So I backed out my changes but the display was still messed up. I eventually started over, wasting a lot of time, and found a completely different project structure. I am now trying to add a TouchController since CubeMX does not include those drivers and has most of the code commented out.

And yes, I have seen all the Designer problems you mention. And there are also a few bugs in CubeMX.

I think I've started over 5-6 times by now :\

PPiar
Associate II

touchgfx CLI also strange. Is there any doc for using it?

seems only command which works there is touchgfx help :\

any other ends up like below:

$ touchgfx list COMPILER
No touchgfx environment variable...
E:/TouchGFX/4.10.0/env/MinGW/msys/1.0/ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/lib/touchgfx/cli/base.rb:18:in `touchgfx_root': unhandled exception
        from E:/TouchGFX/4.10.0/env/MinGW/msys/1.0/ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/lib/touchgfx/cli/base.rb:34:in `source_root'
        from E:/TouchGFX/4.10.0/env/MinGW/msys/1.0/ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/lib/touchgfx/cli/base.rb:39:in `list'
        from E:/TouchGFX/4.10.0/env/MinGW/msys/1.0/ruby193/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from E:/TouchGFX/4.10.0/env/MinGW/msys/1.0/ruby193/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from E:/TouchGFX/4.10.0/env/MinGW/msys/1.0/ruby193/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from E:/TouchGFX/4.10.0/env/MinGW/msys/1.0/ruby193/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from E:/TouchGFX/4.10.0/env/MinGW/msys/1.0/ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/lib/touchgfx.rb:16:in `<module:CLI>'
        from E:/TouchGFX/4.10.0/env/MinGW/msys/1.0/ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/lib/touchgfx.rb:9:in `<module:TouchGFX>'
        from E:/TouchGFX/4.10.0/env/MinGW/msys/1.0/ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/lib/touchgfx.rb:8:in `<top (required)>'
        from E:/TouchGFX/4.10.0/env/MinGW/msys/1.0/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
        from E:/TouchGFX/4.10.0/env/MinGW/msys/1.0/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
        from E:/TouchGFX/4.10.0/env/MinGW/msys/1.0/ruby193/lib/ruby/gems/1.9.1/gems/touchgfx-cli-4.10.0/bin/touchgfx:6:in `<top (required)>'
        from E:/TouchGFX/4.10.0/env/MinGW/msys/1.0/ruby193/bin/touchgfx:22:in `load'
        from E:/TouchGFX/4.10.0/env/MinGW/msys/1.0/ruby193/bin/touchgfx:22:in `<main>'

KMunj
Associate II

​I am trying to do the same. Started with CubeMX 5.0, TouchGFX 4.10.0 and TrueStudio 9.2.0.

I followed all the steps in Tutorial 10 of UM1718.

In my case, I can generate the code in CubeMX. Then I can build it successfully on TrueStudio without any errors.

When I run the debugger, I get following error message all the time;

I think the problem is that .elf file is not getting generated. I searched on my C drive and I can’t find that file.

If anyone knows how to fix it, please let me know.

I have addressed to local ST folks, but I haven't heard anything back.

Thanks

Kiran

Hi,

Did you get anywhere with this issue? I didn't see any attached log or screenshot to your post, so i'm not sure what the precise error you're getting is.

Thanks!

KMunj
Associate II
Hi Martin,
I have not resolved this issue yet.
I have been working with ST BU Manager from Santa Clara office Tim Nakonsut. But he has been out for holiday shutdown.
All I want is updated Tutorial 10 in UM1718. I can’t make current tutorial 10 in UM1718 work. The problem I am see is that when the build is done, it doesn’t create .elf or .bin file and Debugger doesn’t start.
Thank you very much.
Regards,
Kiran