Skip to main content
Soren Myllerup MIKKELSEN
ST Employee
December 17, 2018
Question

Guides for using TouchGFX 4.10 with CubeMX 5.0 & Known limitations.

  • December 17, 2018
  • 17 replies
  • 7232 views

Note:

Recommended to use latest X-Cube-TouchGFC 4.13 release. Can be downloaded here: https://www.st.com/content/st_com/en/stm32-graphic-user-interface.html

Documentation link: https://touchgfx.zendesk.com/hc/en-us/sections/360003093319-TouchGFX-Releases

Guides for using TouchGFX with CubeMX & Known limitations.

This forum post will be updated along with newly acquired information regarding the interoperability of CubeMX and TouchGFX.

TouchGFX knowledge base article overview:

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

This guide gives a general introduction to the workflow of creating an application for graphics with CubeMX and TouchGFX.

There are two ways of getting started with graphics on a ST discovery board

-         1: In TouchGFX Designer select one of the CubeMX enabled Application Templates and start developing graphical applications

-          2: In CubeMX select the desired STBoard from the board selector and add the TouchGFX graphic component. 

Please note, that CubeMX does not provide implementation for BSP layer, these files are located in the respectively STM32Cube package for the selected STBoard.

https://touchgfx.zendesk.com/hc/en-us/articles/360019884752-Configuring-STM32F746G-DISCO

This guide describes how to enable TouchGFX graphics on a STM32F746G-DISCO board stating from the STBoard selector in CubeMX.

Opening from TouchGFX Designer, please note that the Application Template contains 2 versions. Version 2.0 is advised.

https://touchgfx.zendesk.com/hc/en-us/articles/360020001992-Configuring-STM32F7508-DISCO

This guide describes how to enable TouchGFX graphics on a STM32F7508-DISCO board stating from the STBoard selector in CubeMX.

 

https://touchgfx.zendesk.com/hc/en-us/articles/360020208091-Configuring-STM32F769I-DISCO

This guide describes how to enable TouchGFX graphics on a STM32F769I-DISCO board stating from the STBoard selector in CubeMX.

Opening from TouchGFX Designer, please note that the Application Template contains 2 versions. Version 2.0 is advised.

Additional known limitations / updates:

IDEs / Compilers:

IAR is currently working best out-the-box.

More work is needed when using Keil, Atollic, SW4STM32.

Missing BSP Layer

Generating a TouchGFX project from CubeMX, drivers for external components like touch controller and QSPI flash is missing.

TouchGFX Designer error message.

Starting from TouchGFX Designer with an Application templates based on a CubeMX project, the following message appears “Project was modified outside externally�?.

TouchGFX Designer renames the CubeMX and EWARM project files to match the name of the TouchGFX project file.

TouchGFX 4.10

The newest released TouchGFX version is 4.10, available in F4 and F7 Cube packages, and TouchGFX Designer as a stand-alone here; https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/touchgfxdesigner.html

This topic has been closed for replies.

17 replies

BBenn
Associate II
February 18, 2019

I was able to (eventually) get a STM32CubeMX started project fully working in Atollic TrueSTUDIO for an STM32F746G-DISCO board.

If you are targeting Atollic TrueSTUDIO, below are some useful notes based on what I found:

Web guides of note:

A)     Overall guide – except missing specific Atollic True Studio usage. FOLLOW the STM32CubeMX start path of the tree… https://touchgfx.zendesk.com/hc/en-us/articles/360020001492-Getting-Started-with-CubeMX-and-TouchGFX

B)     Missing C++ Symbols: https://community.st.com/s/question/0D50X00009bMlNPSA0/convert-cubemx-project-in-atollic-to-c-pane-to-input-symbols-for-c-missing NOTE: I found a better way, - see below ADDING C++ section.

C)     TouchGFX – as close to a help file as we get… https://touchgfx.zendesk.com/hc/en-us/categories/200529271-Getting-Started

Steps:

1)     Configure your board in SMT32ubeMX, then follow the instructions for adding TouchGFX Middleware under GRAPHICS found on web guide A) – size your display for the real display, not their example. This will start your TouchGXF Designer project as well. For that part, any rough layout is fine – finish the visual/functional design later.

2)     Under the “Project Manager�? tab, “Project�? block, set your project name, pick TrueSTUDIO Toolchain/IDE, select a heap & stack size. I picked to copy all used libraries in the “Code Generator�? block – but it didn’t get them all.

3)     Generate code in STM32CubeMX – follow the instruction order in web guide A) which creates a TouchGFX project as well.

4)     Save your SMT32CubeMX and TouchGFX projects for further use.

Copy the files indicated by web guide A) into the project folders. 

5)     Start Atollic TrueSTUDIO – note that your Workspace location cannot contain your actual project files!! (This messed me up for a while). In your workspace (I suggest one workspace per project!!), import the project you created with STM32CubeMX. It won’t compile – there’s a lot of work to do yet…

6)     Change the project in TrueSTUDIO to a C/C++ project (it’s a pure C project as generated!!). To do so, in TrueSTUDIO select ‘File’ under the main menu. Hover over ‘New’ and on the pop up list, select ‘Convert to a C/C++ Project (Adds C++ Nature)’.

Add the needed include paths to the new C++ compiler settings:  Menu ‘Project’ -> ‘Properties’ ->’C/C++ General’->’Paths and Symbols’. 1)     If you look at the GNU C++ Language, you will see that it is EMPTY. Use the ‘Export Settings’ to generate an XML file – edit that XML file in Notepad++. Duplicate the section <language name="C Source File"> and name the new one <language name="C++ Source File">. Save the edited version. In TrueSTUDIO, use the ‘Import Settings’ – now the GNU C++ language has the same paths as is needed.

7)     Under the ‘Libraries’ tab, if missing, add ‘touchgfx-float-abi-hard’ and ‘touchgfx’ (Note: the file names are libtouchgfx-float-abi-hard.a and libtouchgfx.a but GNU adds the ‘lib’ and the ‘.a’)

8)     Under ‘Library Paths’ add Middleware/ST/TouchGFX/touchgfx/lib/core/cortex_m7/gcc (provided your processor is an m7).

9)     Under the ‘C/C++ Build’->’Settings’->’Tool Settings’->’C++ Compiler’->’Optimization’, check the box beside ‘Disable RTTI’

10)     Close project properties. In the ‘Project Explorer’, go through the folders and for all ‘template’ files and other IDE types, use a right click menu ‘Resource Configuration’->’Exclude from Build’ (select all configurations) to keep them from being compiled. The same for the whole folders ‘build’ and ‘simulator’ under folder ‘TouchGFX’.

11)     This is probably not the proper way to do this step, but it works: Edit file ‘startup_stm32f746xx.s’ (where 746 becomes your exact processor type). Replace the line about ½ way down the file ‘.thumb_set SysTick_Handler,Default_Handler’ with ‘.thumb_set SysTick_Handler,osSystickHandler’. This sets up the proper SysTick interrupt handler – but the expected method is to use a define in an include file – which is hard to follow in a debugger!!

12)     The project may compile  and debug now. Maybe. Use TouchGFX to design your screens, and TrueSTUDIO to work out the underpinings. Follow web guide C) for linking actions to software.

eng23
Senior
February 20, 2019

Hello,

I followed all of your instructions and I got a error with the Libraries...

The compiler is not finding the 'libtouchgfx' and ‘touchgfx-float-abi-hard’ (I did the step 7 carefully and many times in different ways...).

Any idea for this error?

I've tried a lot of guides to generate code from STM32CUBEMX to Atollic with TouchGFX and this tutorial is the most complete and now for me I think is the last error to fix!

Thanks.

BBenn
Associate II
February 20, 2019

I hope these snips help - here's my working settings (make sure the library file is REALLY there too - mine wasn't until copied over)

0690X000006DkPbQAK.jpg0690X000006DkPgQAK.jpg

I see an extra reference to the same library was generated when I used SMT32CubeMX again as a test!! So there are TWO different styles for finding the libraries...

MEder
Associate III
February 18, 2019

​bbenntett,

Could you please list the versions you used for TouchGFX, TrueStudio and CubeMX?

I am using the latest versions and struggling to setup a starter project as well. 

Thank You

BBenn
Associate II
February 18, 2019

I apologize for failing to include revision information! TouchGFX version 4.10, Atollic TrueSTUDIO 9.1.0 Build 20181011-1241 and STM32CubeMX Version 5.0.1 (of V1.0)

MEder
Associate III
February 18, 2019

​Thank for the info.

I've managed to Compile, but when creating the elf file I get the error 'Cannot run program "arm-atollic-eabi-g++": Command line too long"  and it is big.

I am running Windows 7, are you under Linux?  This is a common error under Eclipse and Windows.

BBenn
Associate II
February 18, 2019

I am using Windows 10, and no issues with the extremely long command for linking -

arm-atollic-eabi-g++ -o TouchGFXCube.elf Core\Src\freertos.o Core\Src\main.o Core\Src\stm32f7xx_hal_msp.o Core\Src\stm32f7xx_hal_timebase_tim.o Core\Src\stm32f7xx_it.o Core\Src

[...]

\STM32F746GDISCOTests3\CubeGenTouchGFX\TouchGFXCube\Middlewares\ST\TouchGFX\touchgfx\lib\core\cortex_m7\gcc -L../Middlewares/ST/TouchGFX/touchgfx/lib/core/cortex_m7/gcc -Wl,-cref,-u,Reset_Handler -Wl,-Map=TouchGFXCube.map -Wl,--gc-sections -Wl,--defsym=malloc_getpagesize_P=0x1000 -Wl,--start-group -lc -lm -lstdc++ -lsupc++ -Wl,--end-group

(ironically too long to post:* )

This eclipse plug-in might help: https://mcuoneclipse.com/2015/03/29/solving-the-8192-character-command-line-limit-on-windows/

MEder
Associate III
February 18, 2019

Ok, I figured since your referencing the TouchGFX Lib​ that we don't really need to compile most of the framework source. That seemed to improve the cmd line by about 10k.

So...

C:\Program Files (x86)\Atollic\TrueSTUDIO for STM32 9.2.0\ide\jre\bin\java -jar C:\Program Files (x86)\Atollic\TrueSTUDIO for STM32 9.2.0\Tools\arm-atollic-reports.jar sizeinfo list STM32F746-DISCO.elf

Generate build reports...

Print size information

text data bss dec hex filename

1006818 1764 43656 1052238 100e4e STM32F746-DISCO.elf

Print size information done

Generate listing file

Output sent to: STM32F746-DISCO.list

Generate listing file done

Generate build reports done

arm-atollic-eabi-objcopy.exe -O ihex STM32F746-DISCO.elf STM32F746-DISCO.hex

17:29:13 Build Finished (took 1m:52s.725ms)

Progress at least.    now to Flash the Target and debug...

BTW,  I am using  Atollic 9.2.0,   and your post has been the most helpful so far.

MEder
Associate III
February 19, 2019

​Success !!

After setting up the ExtFlashSection in the Linker file,  ST-LINK to flash, and  Setting up the Debugger in atollic.  I finally got running and got Hard Fault at x90000000.  The USB OTG Host was working , and could store files on the device.

I finally followed the  Configuring-STM32F746G-DISCO zendesk article and added the QSPI  code from the article.

Now at least the graphics  show up on the display.   It's too bad it took so long, I was about to give up and go to IAR.

Now I can move forward.

Thanks !!!

Mon2
Senior III
February 19, 2019

@Soren Myllerup MIKKELSEN​ , this information really needs to be a sticky page that can be quickly found. Wasted days in trying to work with a STM32769I-DISCOVERY kit only to realize, this past weekend with thanks to @Martin KJELDSEN​ , that v2.0.0 template is much more refined than template v1.1.0 for this target.

We did find the same Draupner landing page but there is NO mention of the v2.0.0 template use - can that webpage be updated? So the proper "temp fix" would have been to start with this thread and then go to the Draupner page once the IOC project is broken.

Even template v2.0.0 appears to break once CubeMX imports the generated IOC project file and GENERATE CODE is selected inside of CubeMX. Your article on Draupner website is for the most parts, accurate but with assorted typos. After CubeMX breaks the working IOC file, the corrections must be manually applied (as noted on the Draupner landing page).

For future readers, there should be a must read FAQ / sticky page that offers this webpage since this information was available back in December. This info should be quickly available for developers.

The search engine on the ST website is a mess.

BBenn
Associate II
February 21, 2019

It appears only one is missing - libtouchgfx.a (which might not be needed?).

Is it actually in the folder??

I tested the build WITHOUT libtouchgfx.a - and it works fine, just REMOVE that library from "Libraries".

(You can also remove the first entry - the second is how STM32CubeMX generates the settings)

0690X000006DlBpQAK.jpg

Mon2
Senior III
February 21, 2019

@BBenn​ , the missing files are used by the simulator. Learned this from @Martin KJELDSEN​.

or building through the designer the mingw32 library must be present: Middlewares\ST\TouchGFX\touchgfx\lib\win\mingw32\libtouchgfx.a

The SDL libs are inside: Middlewares\ST\TouchGFX\touchgfx\lib\sdl2\win32

We just cut & pasted the above from another working project and this fixed our simulator.

eng23
Senior
February 21, 2019

@BBenn​ , if I remove this library the compiler returns the same error. But I think is necessary because below you can see that the compiler call some functions in this library "touchgfx::HAL::tick()" for example.

Here is my situation:

0690X000006DlFXQA0.jpg

Thanks.

BBenn
Associate II
February 21, 2019

All of those are library functions.

I am thinking perhaps your issue is the "Multiple definitions of MX_GPIO_Init" - there should only be ONE in main.cpp. I wonder if you have a second file included in the build with this function defined?

eng23
Senior
February 21, 2019

@BBenn​ , I have the MX_GPIO_Init function implemented in the gpio.c (generated by cube) and the call in the main.cpp, nothing else. Everything was generated by CubeMX.

About the second file I already searched for this function and appears only in gpio.c, gpio.h and main.cpp files.

Thansk for reply.

BBenn
Associate II
February 21, 2019

Oddly, my generated main.cpp has MX_GPIO_Init (the actual function) at line 1220, and I have no file GPIO.c (GPIO.cpp is just a base type).

Something is very different between what you have generated and mine.

eng23
Senior
February 21, 2019

Could anyone share the project with Atollic + TouchGFX + CubeMX compiling?

At the forum I found the project only for SW4STM32...

Thanks.