cancel
Showing results for 
Search instead for 
Did you mean: 

Same TouchGFX project for multiple CubeMX files in the same CubeIDE project

PontusL
Associate III

Hello,

To elaborate on what I mean and wondering about with the subject using an example:

I am using one CubeIDE project to develop an application for two different hardware boards using the same MCU. Each of these boards have a CubeMX file associated with it since the pinout of the boards differ somewhat. But most of the functionality is the same between the boards, and they share the code on an application layer. I use ifdefs and build configurations to build the desired application. 

Right now, I have a double set of all TouchGFX related files, one in the CubeMX folder for HW1 and one for HW2, which are a complete copy of the other. I instead want to move this code to the application layer level since the code is the same, and changes to the GUI would be implemented to both hardware applications with one change. 

How would I go by doing this? Since the code generation is coupled tightly with CubeMX, can it even, somewhat easily, be done in a reliable way? 

I guess this somewhat also extends to how one would maintain and update a GUI which is used in multiple projects in an easy way. In my head, having the GUI as a module that would be loaded into the desired application would be an option, but I have not found any source about this being done. Does anyone have any input or inspiration here?

Regards,
Pontus

13 REPLIES 13

Unfortunately, there is no instruction for importing a GUI through command-line. 

And, my suggestion was to have 3 different projects, but you only need to change one of them, the other two is like a copy paste, which is done by importing the GUI.

Also, as @MM..1 mentioned, TouchGFX and STM32CubeMX are tightly connected which means there are some settings of the CubeMX project that are reflected in the TouchGFX project. Therefore, it is not possible to just use the common TouchGFX files between the two projects. 

Best regards,

Mohammad MORADI
ST Software Developer | TouchGFX

Hello @PontusL ,

Have you made any progress on this topic? 

Mohammad MORADI
ST Software Developer | TouchGFX

Hello Mohammad,

No, not really any progress. What I do is that I develop my GUI for one hardware and then use the import gui functionality in TGFX designer to import my changes for the other hardware. It works but is a bit tedious. I also dislike having duplicate setups of the touchgfx files, since my project is fairly large, but it works for now. 

 

Solution: You can't have one TouchGFX project for multiple CubeMX projects. 

 

//PontusL

I'm glad that at least you are progressing, but I understand that unfortunately, there are no better solutions.
Could you select an 'Accepted Solution'?

Mohammad MORADI
ST Software Developer | TouchGFX