2023-12-12 10:08 AM
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:
Adding a button and generating the code yields the following project docs:
Opening the generated cproject file imports the following project:
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:
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:
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.
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:
I select the "ApplicationTemplate.touchgfx.part" to open the TouchGFX app, select a blankUI canvas, add a button and click generate code withini TouchGFX.
Refreshing the code in the CubeIDE and building project yields errors right out of the gate:
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.
Solved! Go to Solution.
2023-12-15 03:03 AM - last edited on 2023-12-15 05:15 AM by GaetanGodart
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.iocLinking file to CubeIDE project
2023-12-14 04:46 AM
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
CubeIDE
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
2023-12-14 06:04 AM
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?
2023-12-15 03:03 AM - last edited on 2023-12-15 05:15 AM by GaetanGodart
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.iocLinking file to CubeIDE project