cancel
Showing results for 
Search instead for 
Did you mean: 

Generate Under Root: code gen overwrites lib location in IDE

DragonSal
Associate II

TouchGFX version 4.25.0 CubeMX version 6.17.4*  STMCubeIDE version 2.0.0

*edited version

I created a development environment starting with TouchGFX and used Generate Under Root in CubeMX.  This did a great job of setting up the directory structure without links so that it is easier to navigate in the STM32CubeIDE application.

Part of this process automagically moves the middleware and driver directories from the STM32CubeIDE directory to the root directory.

When the .project file is created by the TouchGFX code generation it handles the movement of all these files and include directories like a champ, except the Properties=>C/C++ Build=>Settings=>MCU/MPU G++ Linker=>Libraries=>Library search path for the libtouchgfx-float-abi-hard.a library.

It sets the path to "${workspace_loc:/STMCubeIDE/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc}" instead of "${workspace_loc:/${ProjName}/Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc}"

It's a quick fix to edit it to the correct value.  Unfortunately every time you Generate Code in TouchGFX and do a refresh of the project in the STM32CubeIDE application it changes it back.

My question is:  Can this be fixed by the developers in a future release?

I've attached a word document with instructions on how to set up the environment.  I apologize for the overuse of screenshots.  I tried to make it so that the instructions could be followed by myself in six months.  The document was also written with the intention of combining what the IDE gives for a new project on the STM32F769I-DISCO board with what TouchGFX gives for a new project.  The IDE gives no display, and TouchGFX gives no GPIOs besides the display.

Tony

1 ACCEPTED SOLUTION

Accepted Solutions
ferro
Lead

@DragonSal 

Create build variables pointing to libs so that GfxDesigner does not overwrite.

build_variables.png

Example how to create a variable

build_variables_example.png

And now, create linker lib paths using those build variables

"${ProjDirPath}/${LibPathTouchGfxFloatAbiHard}"
"${ProjDirPath}/${LibPathNemaFloatAbiHard}"
"${ProjDirPath}/${LibPathTouchGfxNemaFloatAbiHard}"

Tyou should see this

lib_paths.png

 

 

View solution in original post

11 REPLIES 11
Osman SOYKURT
ST Employee

Hello @DragonSal ,

Thank you for the document, I'll review it. However, I would like to understand why you need to select "Generate under root", and what issue you face when you don’t use it.

When TouchGFX generates code, it actually searches for a folder in which it can modify the project file by adding new links, dependencies, and everything needed for correct compilation. For this reason, we have the folders "EWARM", "MDK-ARM", and "STM32CubeIDE".

The EWARM and MDK-ARM toolchains do not have a "Generate under root" option, so it is simpler for us to unify everything at the code generation step by always looking for the project file one level below the root.

I hope this clarifies the reason behind this behavior.

Osman SOYKURT
ST Software Developer | TouchGFX

Hi @Osman SOYKURT 

I am trying to use the full functionality of the STM32F769I-DISCO board.  As stated at the end of my comments above, "The document was also written with the intention of combining what the IDE gives for a new project on the STM32F769I-DISCO board with what TouchGFX gives for a new project.  The IDE gives no display, and TouchGFX gives no GPIOs besides the display."

I have searched ST documents, tools, community boards, and tutorials to determine how to combine them in an official manner.  What I have found is other people trying to do the same thing with no clear answer on how to do it

I have tried many ways of combining what TouchGFX gives and what the IDE gives so that there is a project that uses the full functionality of the discovery board.  When I use the STM32CubeIDE directory, the header files are set up in the IDE as reference links.  This results in the search for references and definition tools that are part of the IDE to not work.  As a result, you have to manually search through the codeset to find what you want.

When I use "Generate from Root" I am able to use those tools in the IDE because the links are gone.  And honestly, it's just easier to work with the IDE when you can actually see where the code exists instead of having to go through levels of obfuscation.

Using the steps I have given in the document, you can combine the two projects together and have everything working.  It isn't too difficult to do, and there is only one issue that remains.  The issue is with the path to the library being overwritten every time TouchGFX generates code.

If you have an STMicro way to combine the TouchGFX and STMicro IDE tools so that the full functionality of the discovery boards is available, please point me to it.  It would be great to not to have to go through all these extra steps.

I do find it strange that the code and directory paths for everything except that library are properly moved, yet that library directory path is an issue.  The library itself is moved along with the rest of the code.

Regards,

Tony Saladino

ferro
Lead

@DragonSal 

Or try a simpler fix compared to my previous post.

You need to change project name in .cproject as well - that is where GfxDesigner fetches project name to point to libs.

Go towards the end of .cproject and change 2 places where old project name is

testap.png

 

 

 

Hi @ferro 

Thanks for the suggestions.

I have made the changes to add the relative directory as you suggested in the linked post.  The issue is that when you "Generate code" in TouchGFX, it resets it back to the old, now incorrect, directory.  It removes the relative path.

The line you show in the .cproject file is updated in my .cproject file.  I believe when you update line 3 in the .project file to show the correct name, it will update the .cproject file.  If it doesn't, I just missed it when I documented the steps I took.

Cheers,

Tony Saladino

Hm, try to delete those paths in CubeIDE and run GfxDesigner again.

I'm confused at what we're solving now.  I have everything working.  The only issue is that when I make changes in TouchGFX, then refresh code in CubeIDE, the library path gets overwritten with the absolute path.  So everytime I make changes in TouchGFX and bring them into the larger project, I have to reset the library path to a relative path.  I was just checking to see if that can be fixed in a later release.

"I'm confused at what we're solving now."

We are solving Gfx overwritinh the lib search paths in .cproject. I solved this issue few days back, I looked into my notes and I changed .cproject at the end (you hve done that) and then I deleted lib paths in CubeIDE. After I ran GfxDesigner new paths were ok. Could you try to delete in CuebIDE ?

ferro
Lead

@DragonSal 

Create build variables pointing to libs so that GfxDesigner does not overwrite.

build_variables.png

Example how to create a variable

build_variables_example.png

And now, create linker lib paths using those build variables

"${ProjDirPath}/${LibPathTouchGfxFloatAbiHard}"
"${ProjDirPath}/${LibPathNemaFloatAbiHard}"
"${ProjDirPath}/${LibPathTouchGfxNemaFloatAbiHard}"

Tyou should see this

lib_paths.png