cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX Issues generating code for Cube IDE: GFX create Cube Proj or Cube Proj make GFX?

IHarg.1
Associate III

Hello,

I am having an issue with the relationship between TouchGFX(4.23.0) and STM32CubeIDE(1.14.0). Creating a TouchGFX project through a CubeIDE project and creating CubeIDE project through TouchGFX, seem to give differing results and challenges.

Parameters:

TouchGFX(4.23.0)

STM32CubeIDE(1.14.0)

STM32CubeMX(6.10)

STM32F429I-DISC1 (MB1075-F429I-E01)

STM32H7B3I Evaluation

CubeIDE project through TouchGFX

When creating a TouchGFX project with the STM32F429I-DISC1 board, I get the following:

IHarg1_0-1702401762273.png

Adding a button and generating the code yields the following project docs:

IHarg1_1-1702402080926.png

Opening the generated cproject file imports the following project:

IHarg1_2-1702402213789.png

Notice that the IOC(MX) file has a different naming convention. The project seems to be the a older board revision.

Note: I have seen and tried some online tutorials for adding the IOC file into the project, but this leaves the user needing to set up the .IOC file and I get the following message:

IHarg1_3-1702402351629.png

Not to mention several build errors.

TouchGFX project through a CubeIDE project

Next I tried the other route: Generating GFX files via cubeIDE like so:

IHarg1_4-1702402539493.png

Generating the project and selecting no for default pin values, I find myself at the IOC file where I need to select the TouchGFX middleware layer manually.

IHarg1_5-1702402680468.png

IHarg1_6-1702402700381.png

I would expect the IOC to know the dev kits screen size and configurations for buffers, ext RAM, etc. Nevertheless, after fixing the CRC enable issue, and screen size, and generating code, I get the following project:

IHarg1_7-1702402978843.png

I select the "ApplicationTemplate.touchgfx.part" to open the TouchGFX app, select a blankUI canvas, add a button and click generate code withini TouchGFX.

IHarg1_8-1702403253427.png

 

Refreshing the code in the CubeIDE and building project yields errors right out of the gate:

IHarg1_9-1702403455965.png

Both options have not been very intuitive. I have seen tutorials online where people are able to generate code from TouchGFX and simply open the cproject in STM. Their .IOC file is preset for TouchGFX and the specific dev board. I have tried the similar approaches using also the STM32H7B3I Evaluation board using GFX to generate my code. After having to manually setup touchGFX in the .IOC file I quickly ran out of RAM. My project is much smaller than even the demos, so I believe I do not have it configured correctly to use external RAM on the dev board.

In conclusion I am looking for guidance on best practices for generating a user interface file and editing project for customization in the Cube IDE. What am I do wrong?

Thanks for stopping by!

Isaac.

 

1 ACCEPTED SOLUTION

Accepted Solutions

I'm glad to hear you are on a good start.
To link the CubeMX project to your CubeIDE one, you can right click on the project, select New -> File and then in the opened window, click on the Advanced button. Check the option "Link to file in the file system" and in the search section you can write: 
${PARENT-1-PROJECT_LOC}\STM32F429I_DISCO_REV_E01.ioc


Linking file to CubeIDE projectLinking file to CubeIDE project

 

Mohammad MORADI
ST Software Developer | TouchGFX

View solution in original post

3 REPLIES 3

Hello @IHarg.1 ,

First of all, thank you for the comprehensive explanation with all the details. 
I will start talking about the first approach which is the easiest one (Creating project through TouchGFX). TouchGFX board projects are made to make the creation of a GUI as simple as possible, so, all the configurations related to the board and the MCU are already done. This is not the case when you create a project through STM32CubeMX. 
I can see that CubeMX has failed to download the X-CUBE-TOUCHGFX 4.23.0, please follow the instruction on this post to install it : https://community.st.com/t5/stm32-mcus-touch-gfx-and-gui/x-cube-touchgfx-4-23-0-is-out/td-p/616481

 

For creating a project, I suggest you to start your project from the TouchGFX Designer by choosing the board you are working on. Then, design your application and generate code. After that, navigate through the STM32CubeIDE and open the .cproject file. In the IDE, implement you logic behavior (code, functions,..) under Includes -> gui/Include -> gui -> "YourScreen" -> "YourScreen".hpp and Application -> User -> gui -> "YourScreen".cpp 


CubeIDECubeIDE

 

Then, you can either go back to TouchGFX and press the "Program and Run Target", or build the project in STM32CubeIDE and then program your board using the built file (.hex file under Debug or Release folder) and STM32CubeProgrammer. 

All these process is also mentioned in this tutorial: 
https://support.touchgfx.com/docs/tutorials/tutorial-02

I hope this helps you, don't hesitate to ask more questions

Mohammad MORADI
ST Software Developer | TouchGFX
IHarg.1
Associate III

Hello,

Thank for the response. It was quite helpful. I have updated to X-CUBE-TOUCHGFX 4.23.0. Moving forward with the dev kit, I will definitely heed your advice on workflow. In your screenshot, I noticed your project does not include the .IOC or MX file from the project directory. How would you go about importing that into the project?

I'm glad to hear you are on a good start.
To link the CubeMX project to your CubeIDE one, you can right click on the project, select New -> File and then in the opened window, click on the Advanced button. Check the option "Link to file in the file system" and in the search section you can write: 
${PARENT-1-PROJECT_LOC}\STM32F429I_DISCO_REV_E01.ioc


Linking file to CubeIDE projectLinking file to CubeIDE project

 

Mohammad MORADI
ST Software Developer | TouchGFX