cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429I-DISC1: Is there a simple way to create a touchGFX project that has an .ioc file ?

Nikos Mich.
Associate II

for STM32F429I-DISC1, the Designer creates a project that does not contain an .ioc file. This means that any functionality additional to the graphics must be configured by code instead of CubeMX. Is there a simple way I can have an .ioc file in the project?

Nikos

1 ACCEPTED SOLUTION

Accepted Solutions
Karl Yamashita
Lead III

If you followed my video then you should be able to open the IOC file in STM32CubeIDE. I never use CubeMX for any of the TouchGFX projects.

If you try to create a TouchGFX project from within STM32CubeIDE then you'll need to know all the parameters to setup for the LCD.

It's best to have TouchGFX generate the code and folder structure then import into STM32CubeIDE. All the parameters for the LCD is populated for you by TouchGFX

If smoke escapes your device, put the smoke back in. It'll still work as a conversation piece. If you find my answers useful, click the Accept as Solution button so that way others can see the solution.

View solution in original post

9 REPLIES 9
Karl Yamashita
Lead III

If you imported it into STM32CubeIDE it won't show in the folder structure. You just have to navigate to the folder in Explorer and drag the file onto the project in the IDE and when prompted, link to the file.

https://youtu.be/AizWAlbU4Og?t=427

If smoke escapes your device, put the smoke back in. It'll still work as a conversation piece. If you find my answers useful, click the Accept as Solution button so that way others can see the solution.
Romain DIELEMAN
ST Employee

Hello,

When you create a project with the STM32F429I-DISC TouchGFX Board Setup in TouchGFX Designer, you always have an ioc file generated. Navigate to the folder where your projects are generated and you will see it. Or like what Yamashita said, you do not see it in STM32CubeIDE ? To be honest we often recommend to not open the ioc file directly in STM32CubeIDE but rather in STM32CubeMX directly.

/Romain

Nikos Mich.
Associate II

Hello,

Thank you both for your help.

Karl: I tried what you suggest and when I try to open the .ioc file in STMCubeIDE I get the error message "Invalid input: Must be projects active .ioc file". I guess I have to watch the entire video carefully and perform the filename changes suggested in each step. It seems well done.

Romain: I don't understand what you suggest, I think I do not understand the expected standard workflow for a beginer using the discovery board for touchGFX graphics plus additional IO functionality in the STMCubeIDE environment. My understanding is that all work is done within STM32CubeIDE and that an .ioc file is expected to be present in the project structure. There is an .ioc file in the generated files, which I do not see in STMCubeIDE project structure when I import the project. Is this file actually used by the project? If so, why I cannot access it from the project structure? I think my confusion comes from that the code gerenated by touchFGX may be used for other platforms than CubeIDE, but how can I boil it all down to a standard workflow that ends in a normal CubeIDE project?

Nikos

Hi,

An ioc file is a STM32CubeMX project and not a STM32CubeIDE project. You do have the option to open it in STM32CubeIDE, but those are 2 different tools. We suggest opening the ioc file in STM32CubeMX and set the IO functionality you wish there.

How did you start your project exactly? Directly from TouchGFX Designer or from scratch in STM32CubeIDE? TouchGFX projects are fully configured projects we have set ourselves so that users can quickly develop UIs and run them on target. Those projects are started from STM32CubeMX which then generates a STM32CubeIDE project.

/Romain

Nikos Mich.
Associate II

Hello,

my effort is to create for my company entry-level experience in STM32 development for IO functionality + graphics for a discovery board in the CubeIDE environment. I tried three approaches. Initially, I tried to develop a CubeIDE project from scratch. I got lost on the way. Then, I created a project directly from the TouchGFX designer, took its .ioc file and created a new CubeIDE project from this ioc file. I got lost on this way too. My last effort was to start directly with the TouchGFX designer and use the generated files as a starting point for developing the complete CubeIDE project. I got lost again.

Am I getting this corectly: 1) I should install CubeMX separately from my current CubeIDE installation 2) Open the .ioc file from CubeMX and change some stuff so as it generates the code in the familiar form of the CubeIDE project structure 3) Generate code 4) Import to CubeIDE and all is fine.

Nikos

Karl Yamashita
Lead III

If you followed my video then you should be able to open the IOC file in STM32CubeIDE. I never use CubeMX for any of the TouchGFX projects.

If you try to create a TouchGFX project from within STM32CubeIDE then you'll need to know all the parameters to setup for the LCD.

It's best to have TouchGFX generate the code and folder structure then import into STM32CubeIDE. All the parameters for the LCD is populated for you by TouchGFX

If smoke escapes your device, put the smoke back in. It'll still work as a conversation piece. If you find my answers useful, click the Accept as Solution button so that way others can see the solution.

I don't personally like that workflow but Karl is trustworthy ^^, so follow his videos if you prefer to import a TouchGFX project directly to STM32CubeIDE instead of starting from scratch from STM32CubeMX.

Concerning the step 4 you mentioned @Nikos Mich.​ you don't need to import into STM32CubeIDE as it will generate a STM32CubeIDE project for you under the <pre project folder location>/<project name>/STM32CubeIDE folder (just double click on .cproject or .project instead of trying to import something). Just remember to untick the generate under root option before generating code from STM32CubeMX as stated in the documentation (do read it, especially all the getting started and Development articles, it will help you and give you all the steps).

/Romain

Nikos Mich.
Associate II

I followed Karl's video and it works. Technically, this is an answer to my question as I put it. However, this solution leaves me with a messy folder structure and workflow. I will come back for more help but under a more suitable question title.

Nikos Mich.
Associate II

Here is the solution I found how to create a SMT32cubeIDE project with TouchGFX functionality that has similar folder structure to a touchGFX project created in STM32cubeIDE from scratch:

1.   Create a dummy project from TouchGFX designer for your discovery board. Put in the GUI just a box. Generate code.Then, close the TouchGFX designer.

2.   Somewhere in your PC create a Folder with the name of the project you wish to create, let’s say “base�?.

3.   Open the .ioc file of the project created with TouchGFX designer with CubeMX. Open with CubeMX and not from STM32cubeIDE. Go to File->Save Project As.. and save the project in the folder you have created in Step 2. CubeMX names automatically the new project (i.e. the new .ioc file) with the same name as the folder you will save it in, so the file that will be produced is base.ioc. Then go to the tab “Project Manager�? and select Project->Toolchain/IDE STM32CubeIDE and “tick Generate Under Root�?. Save the project. Press “Generate Code�?. Close CubeMX.

4.   Open with Windows explorer the folder of the project that was created with TouchGFX and in a new window open the project that you created in Step 3 (we will call it “base project�? from now on) .

   a)   One-by-one copy the following folders from the folder of the TouchGFX Designer project to the folder of base project so that they overwrite the existing folders: “Core�?, “Drivers�?, “Middlewares�?.

   b)   Go to the folder “TouchGFX�? of the TouchGFX Designer project and copy one-by-one all the folders contained in it to the folder “TouchGFX�? of base project.

   c)   Go to the folder “STMCubeIDE�? of the TouchGFX Designer project. Copy the two .ld files to the root folder of the base project so that they overwrite the existing files.

   d)   Go to the folder “STMCubeIDE\Application\Startup�? of the TouchGFX Designer project and copy the .c file to the “Core\Startup�? folder of the base project so that it overwrites the existing file.

   e)   Go to the folder “STMCubeIDE\Application\User�? of the TouchGFX Designer project and copy the .c files to the “Core\Src�? folder of the base project so that they overwrite the existing files.

5.   Import the base project to STM32CubeIDE. Expand the project in the project explorer and click on the file “ApplicationTemplate.touchgfx.part�? to open the TouchGFX designer. Then, choose “Black UI�? and create a simple GUI just using a box and Text. Generate code and close TouchGFX.

6.   In the STM32CubeIDE, click on the ioc file and then Generate code.

7.   Build all. Some errors will be produced, because the compiler cannot find the .h files of the BSP. Go to the project name, right click and then go to properties to add the include paths for these header files. Unlike other IDEs, the files added to the project explorer are not included automatically to the compiler’s paths and so this must be done manually. Instructions for this are available online. Here is a rough way to do it. Properties->C/C++ Build->Settings->MCU GCC Compiler -> Include path. Add the path to the header file that the compiler couldn’t find. And also Properties->C/C++ Build->Settings->MCU GCC Compiler -> Include path. Add the path to the header file that the compiler couldn’t find. They are in the folder �?Drivers/BSP/Components�? of the base project. It is also best to change the #includes in the code from a path e.g. #include “Components/ili9341.h�? to just the filename #include “ili9341.h�?

8.   You are Done!! You can use project base as a starting point for your TouchGFX projects.