Skip to main content
lsoon
Visitor II
April 13, 2020
Solved

error: 'OSWrappers' has not been declared

  • April 13, 2020
  • 4 replies
  • 3997 views

Hi everyone,

STM32CubeIDE 1.3.0

32F746-Dicovery

In the above environment, I chose TouchGFX as an additional software and added graphics.

And I created a simple GUI for testing by opening the file in the created TouchGFX directory.

And when compiling, the following error appeared.

../TouchGFX/target/generated/TouchGFXGeneratedHAL.cpp:35:32: error: 'OSWrappers' has not been declared

   registerTaskDelayFunction(&OSWrappers::taskDelay);

                ^~~~~~~~~~

make: *** [TouchGFX/target/generated/subdir.mk:28: TouchGFX/target/generated/TouchGFXGeneratedHAL.o] Error 1

make: *** Waiting for unfinished jobs....

​Is there any way to solve it?

Thank you.

This topic has been closed for replies.
Best answer by Martin KJELDSEN

Finished my tests. .ioc file definitely says STM32CubeIDE as expected - Great!

ProjectManager.PreviousToolchain=
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=746gtest.ioc
ProjectManager.ProjectName=746gtest
ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=STM32CubeIDE
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=true
ProjectManager.functionlistsort=
  • Add TouchGFX from Additional Software in CubeMX and generate code. Failures in compilation due to missing TouchGFX bootstrap.
  • Open the .part file in TouchGFX designer and generate code. Here's part of what happened to the .cproject file (include paths).
✔ ~/STM32CubeIDE/workspace/746gtest2 [master L|✚ 1…15]
21:47 $ git diff
...
+ <listOptionValue builtIn="false" value="../TouchGFX/target/generated"/> 
+ <listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/> 
+ <listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F7xx/Include"/> 
+ <listOptionValue builtIn="false" value="../Core/Inc"/> 
+ <listOptionValue builtIn="false" value="../Drivers/STM32F7xx_HAL_Driver/Inc"/> 
+ <listOptionValue builtIn="false" value="../TouchGFX/App"/> 
+ <listOptionValue builtIn="false" value="../Drivers/STM32F7xx_HAL_Driver/Inc/Legacy"/> 
+ <listOptionValue builtIn="false" value="../TouchGFX/target"/> 
+ <listOptionValue builtIn="false" value="../Middlewares/ST/touchgfx/framework/include"/> 
+ <listOptionValue builtIn="false" value="../TouchGFX/generated/fonts/include"/> 
+ <listOptionValue builtIn="false" value="../TouchGFX/generated/gui_generated/include"/> 
+ <listOptionValue builtIn="false" value="../TouchGFX/generated/images/include"/> 
+ <listOptionValue builtIn="false" value="../TouchGFX/generated/texts/include"/> 
+ <listOptionValue builtIn="false" value="../TouchGFX/gui/include"/>

Compiling OSWrappers.cpp without issues - Remember to press F5 on your CubeIDE project to reload changes to .cproject file! Classic eclipse. Once you do, TouchGFX will appear in the "Middlewares" folder.

make -j8 all 
arm-none-eabi-g++ "../TouchGFX/target/generated/OSWrappers.cpp" -mcpu=cortex-m7 -std=gnu++14 -g3 ....
arm-none-eabi-g++ "../TouchGFX/target/generated/TouchGFXConfiguration.cpp" -mcpu=cortex-m7 -std=gnu++14 ...
arm-none-eabi-g++ "../TouchGFX/target/generated/TouchGFXGeneratedHAL.cpp" -
...

And finally we're done:

Finished building target: 746gtest.elf
 
arm-none-eabi-size 746gtest.elf 
arm-none-eabi-objdump -h -S 746gtest.elf > "746gtest.list"
arm-none-eabi-objcopy -O binary 746gtest.elf "746gtest.bin"
 text	 data	 bss	 dec	 hex	filename
 94822	 2316	 3248	 100386	 18822	746gtest.elf
Finished building: default.size.stdout
 
Finished building: 746gtest.bin
 
Finished building: 746gtest.list
 
 
22:11:55 Build Finished. 0 errors, 0 warnings. (took 14s.423ms)

 Going to bed so i won't see answers until tomorrow. Good night! ;)

/Martin

4 replies

Martin KJELDSEN
Principal III
April 29, 2020

Hi,

Sounds like OSWrappers was not generated or was deleted somehow. Can you try generating again from CubeIDE?

/Martin

Woula
Associate II
July 22, 2020

Hi,

Did you find a solution for that problem, i got the same. I'm trying to create a TGFX application from CubeIDE. But this error halted me. And i don't know how to solve it.

Thanks!

Martin KJELDSEN
Principal III
August 10, 2020

Which version of CubeIDE? I will try to do some tests.

PMich.1
Associate
August 23, 2020

4 months later - the same problem - tGFX 4.14, CubeIDE in the latest version

Solution:

for c and c++ add "TouchGFX/touchgfx/framework/include" as include path

then another error -> solution: add "TouchGFX/generated/texts/include" as include path

another error -> exclude from build - simulator directory

next error (no fonts/ApplicationFontProvider.hpp) -> solution: add "TouchGFX/generated/fonts/include" as include path

next error (no gui/common/FrontEndHeap.hpp) -> solution: add "TouchGFX/gui/include" as include path

next errors - with screens -> solution: add "TouchGFX/generated/gui_generated/include" as include path

next error - with SDL2 include - exclude from build "TouchGFX/touchgfx/framework/include/platform/hal/simulator"

next - add "TouchGFX/generated/images/include" as include path

next - exclude SDL2TouchController.cpp

next - exclude TouchGFX/generated/simulator

next - exclude TouchGFX/simulator

next - exclude TouchGFX/touchgfx/os/OSWrappers.cpp

next - exclude TouchGFX/touchgfx/os/OSWrappers_cmsis.cpp

next- add "TouchGFX/touchGFX/lib/core/cortex_m7/gcc/" as library path

next - add ":libtouchgfx-float-abi-hard.a" as library

finally compile simple application =)

So - as summary -> after generating project in CubeIDE and then after selecting tGFX from cubeMX perspective (which is example way from documentation) there is no paths configurations added to project :\

BTW -> right we can't download tGFX 4.14 from site :\ site stays always on "login" step with download button

Martin KJELDSEN
Principal III
August 24, 2020

​Hi,

Sounds to me like you might not have pressed "Generate code" from the designer. It should insert all the include paths you need, and generate the files required (and also exclude the simulator folder - Eclipse project cpp settings will include every cpp file in the project because of the defined pattern).

I'll look into the download issue.

/Martin

PMich.1
Associate
August 24, 2020

TGFX code is generated - but there is no change in eclipse project in terms of paths/includes etc.

PMich.1
Associate
August 31, 2020

Ok - so can someone from ST confirm this issue or we need to wait another 4months?

Martin KJELDSEN
Principal III
August 31, 2020

Since you asked so nicely, i'll get off the couch and verify this right now.

/Martin