cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX 5.1.0 with TouchGFX never compiles in TrueStudio

eng23
Senior

I started the project in CubeMX 5.1.0 from STM32F746DISCO board and it compiles ok, but when I add TouchGFX graphics TrueStudio always returns error when build.

The errors are similar like "undefined reference to `MX_FREERTOS_Init()" or "undefined reference to `typeinfo for touchgfx::DMA_Interface". But for example the function "MX_FREERTOS_Init()" is properly declared.

I've starded in CubeMX from board, from MCU, tried in differents ways but in the end always the same result.

Anyone was able to build ok from CubeMX and TouchGFX in TrueStudio?

15 REPLIES 15
Martin KJELDSEN
Chief III

Hi,

We were hoping these issues with Atollic would've been fixed in CubeMX 5.1.0. I will try to get a hold of the CubeMX team to discuss this further.

Sorry for the inconvenience!

Best regards,

Martin

Hi @Martin KJELDSEN​ ,

Thanks for reply. Yes I was hoping the version 5.1.0 could resolve this too..

Well while the official position doens't come, I ask some doubts about the code:

Do the folders "Middlewares/ST/TouchGFX/touchgfx/framework/include/platform/hal/simulator" and "Middlewares/ST/TouchGFX/touchgfx/framework/source/platform/hal/simulator" need to be excluded from build?

  • If they are builded my error is:

SDL2/SDL_video.h: No such file or directory

But this file is in the folder tree and the path I added in project options.

  • If I exclude from build my error is:

The file "platform\driver\touch\SDL2TouchController.cpp" include <platform/hal/simulator/sdl2/HALSDL2.hpp>. This file is not created by TouchGFX, I need to include mannualy from Cube Repository, but it is inside the "simulator" folder, so I don't know what to do in this case.

Regards,

Anderson

Yes, they most certainly should. This was one of our inputs for 5.1 but i guess it didn't make it. Anything related to simulator/HALSDL should not be there. SDL2TouchController is for the simulator and should not be included either.

Hope that helps you move forward.

Hello @Martin KJELDSEN​ ,

Thanks for reply. Ok I've removed this files from build and now this is the error:

"Middlewares\ST\TouchGFX\touchgfx\framework\source\touchgfx\containers\Container.o:(.rodata+0x19c): undefined reference to `typeinfo for touchgfx::Drawable"

"Src\STM32F7DMA.o:(.rodata+0x68): undefined reference to `typeinfo for touchgfx::DMA_Interface"

I tried to re-generate files in TouchGFX designer and CubeMX, but it doesn't work.

Hi @eng23​,

Disable RTTI for your project and it should compile!

(Just tried it here - had the same error)

For the MX_FreeRTOS_Init(); error you had, we tried generating the FreeRTOS init code into seperate c/h files (usually its in main.cpp) and were able to get the same error. We then had to move one of the Graphics_ declarations to freertos.c and declare the other method used from within freertos.c as extern "C" from within BoardConfiguration.cpp

Phew.

eng23
Senior

Hi @Martin KJELDSEN​ ,

Thanks for reply. I had disabled RTTI before, I don't know if re-generating code in CubeMX this config is enable again, because now it was enable... by the way, I disabled again but the erros is still there.

Now for example I have a lot of errors "undefined reference to", like:

Src/main.cpp:199: undefined reference to `osThreadCreate'

Src/STM32F7HAL.cpp:103: undefined reference to `touchgfx::OSWrappers::signalVSync()'

Regards.

Hi @Martin KJELDSEN​ ,

Thanks for the support! The MX_FreeRTOS_Init() error I could fix I think with the simulator folders (it was a lot of changes until now!), so with the last RTTI I'm at this point:

0690X0000087Yp9QAE.jpg

For example for "undefined reference to `osThreadCreate'" the file is in the project and the path is declared in project options too.

Regards.