cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE fails to build TouchGFX project due to generated font code

sruby11
Associate

I built a small project using TouchGFX (v4.22.1) and it compiles, simulates, and can be loaded onto an EDT EVK043013B kit. The MCU is STM32F750. When I bring the TouchGFX project into STM32CubeIDE (v1.13.1) and do a build, it gets 1 build error. It is from the TouchGFX generated code:

no matching function for call to 'touchgfx::ConstFont::ConstFont(int, int, int, int, int, int, int, int, int, int, int, int)' GeneratedFont.hpp /EVK043013B/Application/User/TouchGFX/generated/fonts/include/fonts line 34

Again, it build fine in TouchGFX, but has this error in STM32CubeIDE. 

Any idea what could be the issue?

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for the suggestion Mohammad,

Middlewares -> ST -> touchgfx -> framework -> include -> touchgfx was in the include path, but still got this error. I had an example project from the board vendor, so I copied their GeneratedFont.hpp / .cpp files into my project and it got past that error, but then started throwing errors for missing touchgfx SVG include files. I went down a rabbit hole with that, then just decided to abandon that code and start over.

I asked the vendor if they had a STM32CubeMX .ioc file for their board (it wasn't included in their TouchGFX example project). They did end up sending it to me, so I used STM32CubeMX to open it.

  1. Enabled TouchGFX in the Software Packs section.
  2. Then under Pinout & Configuration tab, clicked on X-CUBE-TOUCHGFX, checked the Graphics Application box.
  3. Went to the Project Manager tab, chose STM32CubeIDE as the toolchain / IDE (did NOT check the "Generate under Root" box, and then hit Generate Code.
  4. It created a 'ApplicationTemplate.touchgfx.part' file under the TouchGFX folder in my project. Opened that up with TouchGFX and created the GUI code. 
  5. Pressed the Generate Code button for TouchGFX, then opened used STM32CubeIDE to open the .cproject file in the STM32CubeIDE folder.
  6. Built the project in STM32CubeIDE without errors!

I followed this link Enable TouchGFX in STM32CubeMX  from an answer from one of your other posts that gave me the idea to try this method.

I want to thank you for your knowledge and assistance! 

View solution in original post

3 REPLIES 3

Hello @sruby11 ,

It sounds like STM32CubeIDE has failed to connect the code to the TouchGFX framework code which is placed at Middlewares -> ST -> touchgfx -> framework -> include -> touchgfx

So, make sure the include folder is added correctly to your project. Give us more feedback on this matter
Good luck

Mohammad MORADI
ST Software Developer | TouchGFX

Thanks for the suggestion Mohammad,

Middlewares -> ST -> touchgfx -> framework -> include -> touchgfx was in the include path, but still got this error. I had an example project from the board vendor, so I copied their GeneratedFont.hpp / .cpp files into my project and it got past that error, but then started throwing errors for missing touchgfx SVG include files. I went down a rabbit hole with that, then just decided to abandon that code and start over.

I asked the vendor if they had a STM32CubeMX .ioc file for their board (it wasn't included in their TouchGFX example project). They did end up sending it to me, so I used STM32CubeMX to open it.

  1. Enabled TouchGFX in the Software Packs section.
  2. Then under Pinout & Configuration tab, clicked on X-CUBE-TOUCHGFX, checked the Graphics Application box.
  3. Went to the Project Manager tab, chose STM32CubeIDE as the toolchain / IDE (did NOT check the "Generate under Root" box, and then hit Generate Code.
  4. It created a 'ApplicationTemplate.touchgfx.part' file under the TouchGFX folder in my project. Opened that up with TouchGFX and created the GUI code. 
  5. Pressed the Generate Code button for TouchGFX, then opened used STM32CubeIDE to open the .cproject file in the STM32CubeIDE folder.
  6. Built the project in STM32CubeIDE without errors!

I followed this link Enable TouchGFX in STM32CubeMX  from an answer from one of your other posts that gave me the idea to try this method.

I want to thank you for your knowledge and assistance! 

Glad to hear you managed to get it up and running. 
You're very welcome, happy to help! 

Mohammad MORADI
ST Software Developer | TouchGFX