cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE: Different File Structure

KMew
Senior III

I am using the STM32H7B3I-EVAL, which includes a touch screen that uses the TouchGFX application. I am trying to do its tutorials, which includes modifying the code in the STM32CubeIDE. However, when I do, the file structure is different in my computer's file explorer compared to what is shown in the STM32CubeIDE project explorer.

For example, the TouchGFX folder in my File Explorer is not present in the IDE project explorer.

What causes this and what can be done to fix it?

0693W00000UnLQNQA3.png 

0693W00000UnLQhQAN.png

21 REPLIES 21

Hello Romain,

Yes, that makes sense. So if I wanted to modify the code that is in the ADC_Display/Core/Inc & ADC_Display/Core/Src folder (which is already part of the includes, I can drag both folders from the file explorer and modify it in the IDE?

Nikos Mich.
Associate II

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.