cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE and TouchGFX : re-generating the code messes the project structure.

arnaljl
Associate III

Used ecosystem :

STM32CubeIDE version: 1.4.2 Build: 7643_20200813_1322 (UTC)

TouchGFX vesion 4.5.0 , with STM32F746G-DISCO template version 3.0.2

STM32Cube FW_F7_V1.16.0 Drivers

To repeat the issue :

1) Create a new project using TouchGFX Editor, using STM32F746G-DISCO as template.

2) Add some widgets to the default initial screen (eg. some red text)

3) Save and generate code from TouchGFX Editor.

4) Open the ".project" file from the system's file exporer, letting STM32CubeIDE import it to the current workspace.

5) Compile from STM32CubeIDE : success ! And it runs !

6) Enable a new IP from the CubeMX .oic file (e.g, the USB_OTG_HS as Host Only )

7) Save the .ioc file and let STM32CubeMX re-generate the code.

8) Big HOT MESS in the project directory, the Debug output directory gets added as compilable, two main.c files appear in two separate Core folders, compilation won't succed anymore.

:weary_face: :fearful_face: :loudly_crying_face:

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

TouchGFX is currently creating projects with a name that is derived from the name of the selected board. This leads to problems when you try to open two projects that have the same board as basis because the project name (internal) is the same, even the name of the project folder is different.

To avoid this, you can rename the entire project so that the new project name is reflected throughout the structure. This function is not implemented yet in TouchGFX, but you can do it manually:

  • change file name and also use a text editor to rename all occurrences within the following files:
    • .ioc
    • .touchgfx
  • use a text editor to rename all occurrences within the following files:
    • .project
    • .cproject
    • ApplicationTemplate.touchgfx.part

You could write a script for it (e.g. using PowerShell under Windows), but maybe this will be fixed in one of the next versions of TouchGFX.

When your question is answered, please close this topic by choosing Select as Best.

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
Peter BENSCH
ST Employee

Hi, @arnaljl​ 

I have exactly the same software versions and followed your steps exactly - everything went well and looks fine, no errors, project structure as expected.

Maybe you could save the file .project before and after doing step 6 and compare it afterwards?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
arnaljl
Associate III

I tried the procedure again, but on another machine, and you're absolutely right, @Peter BENSCH​  . It works without trouble.

So I traced back the steps on the very computer that showed this behavior, and the culprit is the Eclipse project naming.

All projects (not project folders, but projects names) issued from TouchGFX, when using the same template, appear in STM32CubeIDE with the name of this very template.

Here's the example : 0693W000005A6gwQAC.png 

So I wager a project renaming from Eclipse (namely STM32CubeIde) was done around step 6) or step 7), which led to this re-generation garbage : the project name mentioned inside the .ioc file wasn't matching, I guess ?

Still, this TouchGFX project naming is a bit of a issue: what's the point of asking for the Application Name in TouchGFX's wizard is it's only reflected on the .touchgfx filename, and not the final C++ project generated by TouchGFX Designer ?

Peter BENSCH
ST Employee

TouchGFX is currently creating projects with a name that is derived from the name of the selected board. This leads to problems when you try to open two projects that have the same board as basis because the project name (internal) is the same, even the name of the project folder is different.

To avoid this, you can rename the entire project so that the new project name is reflected throughout the structure. This function is not implemented yet in TouchGFX, but you can do it manually:

  • change file name and also use a text editor to rename all occurrences within the following files:
    • .ioc
    • .touchgfx
  • use a text editor to rename all occurrences within the following files:
    • .project
    • .cproject
    • ApplicationTemplate.touchgfx.part

You could write a script for it (e.g. using PowerShell under Windows), but maybe this will be fixed in one of the next versions of TouchGFX.

When your question is answered, please close this topic by choosing Select as Best.

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Well I did everything as noted and it worked but then when getting back to TouchGFX designer
it can't generate code or run simulator, giving this:

Post Generate Target
touchgfx update_project
Unable to locate C:/TouchGFXProjects/ADXL355/STM32F746G_DISCO.ioc
Failed
Failed

so I can't go back kand forth between TouchGFX designer and cubeIDE