2022-01-31 03:24 PM
I created a project using the STM32F429I-DISC1 Discovery board. I have spent a couple of days figuring out how TouchGFX integrates with STM32CubeIDE. I am able to create the widgets I need for a project I am goiing to develop. Everything works fine in my test project.
I started the real project today with TouchGFX and used the Discovery Board as a starting point. The new project was created in a new folder. I placed a couple of buttons on the screen as a test. I renamed the generated IOC file, opened it with STM32CubeIDE, and generated the code. When it finished generating the code a box popped up and I clicked "Open Project". I then get this strange message:
Verbatim:
A project 'STM32F429I-DISCIO' already exist into the workspace:
This: C:\TouchGFXProjects\ButtonsLEDs\STM32CubeIDE
Their: C:\TouchGFXProjects\Project2\MultiScreen\STM32CubeIDE
Would you like to remove it and import the new version?
I answered No and the project did not open. So I started over and answered Yes. The project opened and worked like it was supposed to. I then closed the MultiScreen project and tried to open the ButtonsLeds project.
I got an error message saying the project could not be opened as files are missing. Apparently answering Yes to the import question broke the other project. I searched my disk to find the STM32F429I_DISCO_REV_E01 file and it only appears in the STM32CubeIDE\workspace_1.7.0 directory. It had a time stamp of when I answered Yes to the import question.
I have never had an issue creating multiple projects using STMCubeIDE in the past as the projects are always in different folders. Apparently this problem is unique to using the TouchGFX tool when creating a project.
I have two questions.
1) How do I create and open a new project without breaking the last project I worked on? Apparently placing it in another directory doesn't work as STMCubeIDE seems to only know about the STM32CubeIDE\workspace_1.7.0 directory if TouchGFX created the project. There appears to be no way to rename the STM32F429I-DISCO file in a new project to eliminate the conflict.
2) How would I create a project for a custom board when using TouchGFX? Do I need to use one of the Discovery board templates and then modify the IOC file to match the GPIO pins I am using? If I do this, does it break anything in the code that was created by TouchGFX?
Solved! Go to Solution.
2022-02-02 02:33 PM
MM.. 1,
I tried your last method of renaming and placing the IOC file in an empty folder. I tried different methods for a couple of hours and never could get it to work. I was never able to get the code to work properly. It would not compile and always had 9 errors. The first three are shown here.
./TouchGFX/target/generated/TouchGFXConfiguration.cpp:19:10: fatal error: texts/TypedTextDatabase.hpp: No such file or directory
.hpp:22:10: fatal error: touchgfx/hal/HAL.hpp: No such file or directory
OSWrappers.cpp:21:10: fatal error: touchgfx/hal/HAL.hpp: No such file or directory
I finally found a fairly simple method that did work. These are the steps I used.
I edited .project file in the STM32CubeIDE folder. I changed the project name which was STM32F429I_DISCO located on line 3 to my current project name.
As you mentioned in your first post, I changed ProjectManager.ProjectFileName in the IOC file to my current project name. I also changed ProjectManager.ProjectName to my current project name. I did not change the names of the IOC and backup IOC files. I found that if I did that, TouchGFX could no longer compile the code.
Next I changed the STM32F429I-DISCO Debug.launch filename to MyProjectName Debug.launch. Within that file there is a line <listEntry value="STM32F429I-DISCO"/>. I changed the line to <listEntry value="MyProjectName"/>. I'm not sure this change is needed but it may be necessary if you try to debug the project.
I then double clicked the IOC file which started STM32CubeMX. I made a couple of changes to the GPIOs and Enabled the USE_NEWLIB_REENTRANT setting in FreeRTOS. Without this being enabled the code will not compile. I then clicked "Generate Code" and STM32CubeIDE started up and successfully imported the project.
I confirmed I can make changes in TouchGFX and the changes get reflected in the STM32CubeIDE project.
If I look in Username/../workspace_1.7.0/.plugins/.projects directory I see only the names of my project folders. There is no STM32F429I-DISCO file/folder which is the way it should be.
"And project created in TGFX is only for demo , learning ..."
What do you mean by this statement? Is there a better tool for creating LCD display images and operations/interactions with STM32 CPUs? TouchGFX seems like a good tool once you learn the little quirks it has. The really nice part is it creates all the GPIO connections that are needed between the CPU and the LCD board.
2022-02-01 06:37 AM
As first workspace cant handle more projects with same name you can use next workspace
As second rename ioc file dont rename project
ProjectManager.PreviousToolchain=STM32CubeIDE
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=ProjName.ioc
ProjectManager.ProjectName=ProjName
ProjectManager.RegisterCallBack=
ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=STM32CubeIDE
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=true
but change this on existed TGFX poject dont help ...
2022-02-01 09:03 AM
I'm not sure what you are trying to say. I have tried renaming the .IOC file before opening it. After I rename it I open it and then generate code. After code generation finishes I click Open Project and I still get the STM32F429I_DISCO already exists warning.
2022-02-01 09:16 AM
IOC is text file and in is writed name for project, this dont change with file renaming.
You need edit file in for example PSPAD before use (opening in IDE)
Steps is :
1.rename file NEWNAME
2.edit two lines replace old name wit new
ProjectManager.ProjectFileName=ProjName.ioc
ProjectManager.ProjectName=ProjName
2022-02-01 10:24 AM
Where do I find the file PSPAD?
Where do I find ProjectManager.ProjectFileName and ProjectManager.ProjectName? Which file are these two lines in?
2022-02-01 03:03 PM
OK, I figured out that when you said PSPAD you meant something like Notepad. I had never heard of PSPAD.
I edited the two lines in the IOC file. I also searched both files for every occurrence of STM32F429I-DISCO and changed them to my project name (TestTwo). I also edited the .project file and changed this line: <name>STM32F429I_DISCO</name> to <name>TestTwo</name> I then renamed both the IOC file and the backup IOC file to my project name.
When the project opened it still opened with the name STM32F429I_DISCO. So I closed the project and deleted it from the STM32CubeIDE list of projects. I then renamed the STM32F429I-DISCO project in USERNAME/workspace_1.7.0/plugins/org.eclipse.core.resources/.projects directory.
Next U double clicked the IOC filename and it opened in STM32CubeMX. I clicked Generate Code and when the next window popped up I clicked Open Project. When it asked for the project directory. I navigated to the project directory and selected the sub directory that my project was in and clicked Next. The popup window displayed the directory folder hierarchy that my project was in. I deselected all but the exact directory that the project was in. When I did that the project opened properly and I was able to successfully build it. I loaded the bin file to the board and everything worked.
I closed STM32CubeIDE and opened the project in TouchGFX. I added an additional button as a test, generated the code, and closed TouchGFX. I then opened STM32CubeIDE and rebuilt the project. I loaded the bin file and it displayed the new button.
This is a lot of trouble to go to if you need more than one project using TouchGFX, It is curious that It wants to name every project it creates as STM32F429I-DISCO. Plus it always wants to put that project name in the workspace_1.7.0/.../.projects directory. There should be a menu in TouchGFX that would allow you to specify where you wanted all of the project files and filenames to be placed. I guess it is still a work in progress.
Thank for pointing me in the right direction. I made notes in my Lab Notebook so I could refer back to them in the future. It may be a year before I try another project. There is no way I would remember the steps at that time. :face_savoring_food:
Now I need to figure out how to get a TochGFX project working for a custom board. Instinct tells me to use the Discovery board to create the project. Then remove everything not needed for TouchGFX and proceed from there. Of course I have a year to work on this as there won't be any Distributor stock of STM32F429 parts for at least another year.
2022-02-01 10:04 PM
2022-02-02 02:33 PM
MM.. 1,
I tried your last method of renaming and placing the IOC file in an empty folder. I tried different methods for a couple of hours and never could get it to work. I was never able to get the code to work properly. It would not compile and always had 9 errors. The first three are shown here.
./TouchGFX/target/generated/TouchGFXConfiguration.cpp:19:10: fatal error: texts/TypedTextDatabase.hpp: No such file or directory
.hpp:22:10: fatal error: touchgfx/hal/HAL.hpp: No such file or directory
OSWrappers.cpp:21:10: fatal error: touchgfx/hal/HAL.hpp: No such file or directory
I finally found a fairly simple method that did work. These are the steps I used.
I edited .project file in the STM32CubeIDE folder. I changed the project name which was STM32F429I_DISCO located on line 3 to my current project name.
As you mentioned in your first post, I changed ProjectManager.ProjectFileName in the IOC file to my current project name. I also changed ProjectManager.ProjectName to my current project name. I did not change the names of the IOC and backup IOC files. I found that if I did that, TouchGFX could no longer compile the code.
Next I changed the STM32F429I-DISCO Debug.launch filename to MyProjectName Debug.launch. Within that file there is a line <listEntry value="STM32F429I-DISCO"/>. I changed the line to <listEntry value="MyProjectName"/>. I'm not sure this change is needed but it may be necessary if you try to debug the project.
I then double clicked the IOC file which started STM32CubeMX. I made a couple of changes to the GPIOs and Enabled the USE_NEWLIB_REENTRANT setting in FreeRTOS. Without this being enabled the code will not compile. I then clicked "Generate Code" and STM32CubeIDE started up and successfully imported the project.
I confirmed I can make changes in TouchGFX and the changes get reflected in the STM32CubeIDE project.
If I look in Username/../workspace_1.7.0/.plugins/.projects directory I see only the names of my project folders. There is no STM32F429I-DISCO file/folder which is the way it should be.
"And project created in TGFX is only for demo , learning ..."
What do you mean by this statement? Is there a better tool for creating LCD display images and operations/interactions with STM32 CPUs? TouchGFX seems like a good tool once you learn the little quirks it has. The really nice part is it creates all the GPIO connections that are needed between the CPU and the LCD board.
2022-02-03 06:53 AM
Simply you dont write about real job = create sw for custom LCD and boards.
I dont repeat you DISCO story. I explain for real new project exist 3 ways:
In all 3 ways result is TGFX using code.
Thats all Folks :ghost: