cancel
Showing results for 
Search instead for 
Did you mean: 

Missing functions in generated code (TouchGFX 4.14)

villains
Associate II

Dear ST community,

I am trying to build a basic test project for the STM32F469I-DISCO board, using STM32CubeMX 6.0.1 and TouchGFX 4.14. The generated project code fails to build because of a number of absent function implementations. Details below.

Steps to reproduce:

  • Start STM32CubeMX 6.0.1 and create a new STM32F469I-DISCO project with default options
  • Add the TouchGFX Designer 4.14 software pack, and apply default options, set screen size to 800x480
  • Generate code in STM32CubeMX
  • Open the TouchGFX project in TouchGFX Designer 4.14
  • Add a dummy button with label, e.g. "Hello World" and save project
  • Generate code in TouchGFX Designer
  • Attempt to build the project in IDE

As expected, the initial build will fail because of linker errors, caused by missing code that must be added by the developer.

My initial goal is just to get the project to compile, so I added dummy implementations for now (e.g. in OSWrappers.cpp and elsewhere) which I will properly implement later.

Even so, the build fails because of a number of missing functions, that should have been present in the generated code:

undefined reference to `touchgfx::ConstFont::ConstFont(touchgfx::GlyphNode const*, unsigned short, unsigned short, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned short, unsigned short)' GeneratedFont.cpp

undefined reference to `touchgfx::Font::getStringWidthLTR(unsigned char, unsigned short const*, std::__va_list) const' Texts.cpp

undefined reference to `touchgfx::Font::getStringWidthLTR(unsigned char, unsigned short const*, std::__va_list) const' Texts.cpp

undefined reference to `touchgfx::ConstFont::getGlyph(unsigned short, unsigned char const*&, unsigned char&) const'

undefined reference to `touchgfx::Font::getCharWidth(unsigned short) const'

undefined reference to `touchgfx::Font::getSpacingAbove(unsigned short const*, ...) const'

undefined reference to `touchgfx::Font::getMaxTextHeight(unsigned short const*, ...) const'

undefined reference to `touchgfx::Font::getNumberOfLines(unsigned short const*, ...) const'

undefined reference to `touchgfx::Font::getCharWidth(unsigned short) const'

undefined reference to `touchgfx::Font::getSpacingAbove(unsigned short const*, ...) const'

undefined reference to `touchgfx::Font::getMaxTextHeight(unsigned short const*, ...) const'

undefined reference to `touchgfx::Font::getNumberOfLines(unsigned short const*, ...) const'

The declarations for these functions exist in various .hpp files, but the implementations don't exist in any .cpp files in the generated code. I also searched the entire TouchGFX install directory for these functions (C:\TouchGFX\4.14.0) and they don't exist there, either.

I also tried TouchGFX 4.13 with similar results: missing code and cannot compile.

What am I missing?

I think I am following the steps according to the documentation (STM32CubeMX and TouchGFX) and from reading messages here.

Please help... I am completely stuck and unable to proceed with the project.

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Romain DIELEMAN
ST Employee

Hi,

I would advise to create a project from TouchGFX Designer instead of from CubeMX. Creating a project from Designer with the right application template, as you can see in the documentation introduction, will also create you a CubeMX project with all the configuration needed to be able to work with TouchGFX on your board. Starting from CubeMX will require more configuration than just enabling the additional package.

Steps to reproduce:

  • Start STM32CubeMX 6.0.1 and create a new STM32F469I-DISCO project with default options
  • Start TouchGFX Designer
  • Select the application template for the STM32F469I-Disco
  • Select an UI template or not if you wish to start from scratch
  • Create your project, then generate Code (F6)
  • Open the project's folder, you can see the CUbeMX ioc file and projects created for different toolchains. Open the CubeIDE one in your case I suppose
  •  

The documentation will help you get started on your UI development and later on the board bring up if you wish to use a custom board. The tutorials and the UI examples available in TouchGFX Designer are a good starting point to understand how to develop UIs and work with the widgets.

View solution in original post

2 REPLIES 2
Romain DIELEMAN
ST Employee

Hi,

I would advise to create a project from TouchGFX Designer instead of from CubeMX. Creating a project from Designer with the right application template, as you can see in the documentation introduction, will also create you a CubeMX project with all the configuration needed to be able to work with TouchGFX on your board. Starting from CubeMX will require more configuration than just enabling the additional package.

Steps to reproduce:

  • Start STM32CubeMX 6.0.1 and create a new STM32F469I-DISCO project with default options
  • Start TouchGFX Designer
  • Select the application template for the STM32F469I-Disco
  • Select an UI template or not if you wish to start from scratch
  • Create your project, then generate Code (F6)
  • Open the project's folder, you can see the CUbeMX ioc file and projects created for different toolchains. Open the CubeIDE one in your case I suppose
  •  

The documentation will help you get started on your UI development and later on the board bring up if you wish to use a custom board. The tutorials and the UI examples available in TouchGFX Designer are a good starting point to understand how to develop UIs and work with the widgets.

villains
Associate II

Thank you!

Creating the project from TouchGFX Designer worked.