cancel
Showing results for 
Search instead for 
Did you mean: 

error: use of undeclared identifier 'assert'

Nece
Associate

I have a working code generated with STM32CUBEMX and TouchGFX 4.17, which I compiled with Keil using ARM compiler version 5. Now, we have updated the setup, and while trying to compile the code with ARM compiler version 6, Keil throws an error saying 'error: use of undeclared identifier 'assert''. This error occurs in more than 2000+ files related to TouchGFX.

I checked the files where it is throwing errors, and each file has a header #include <touchgfx/hal/Types.hpp>. In the file Types.hpp, the following headers are included:

 

 

#include <assert.h>
#include <stdint.h>
#include <touchgfx/hal/Config.hpp>

 

 

I went through the following articles, but the error still persists. How can I resolve this issue?

https://developer.arm.com/documentation/ka004216/latest/

https://developer.arm.com/documentation/100073/0618/The-Arm-C-and-C---Libraries/Tailoring-the-C-library-to-a-new-execution-environment/Program-exit-and-the-assert-macro

 

1 ACCEPTED SOLUTION

Accepted Solutions
Nece
Associate

Hello @Osman SOYKURT,

Thank you for your inputs. I was able to resolve the issue, and I can now compile the code.

I installed a fresh version of Keil uVision 5.39 and selected ARM:CMSIS v6.0.0 from the Software packs. Additionally, I had to select the recent version of ARM:CMSIS-RTX in the the Software packs.

For some reason, the OSWrappers.cpp file in TouchGFX\target\generated wasn't updated after regenerating the code  with TouchGFXDesigner 4.23.2, so I had to manually include:

#include <cassert>

After doing so, the error was resolved.

View solution in original post

2 REPLIES 2
Osman SOYKURT
ST Employee

Hello @Nece ,

Could you describe the steps your did to upgrade your Keil version of your project?
By the way, could you tell us which board do you use?
"Now, we have updated the setup"  --> do you mean you updated to the newest TouchGFX (4.23.3) and STM32CubeMX (6.11.0)?

Osman SOYKURT
ST Software Developer | TouchGFX
Nece
Associate

Hello @Osman SOYKURT,

Thank you for your inputs. I was able to resolve the issue, and I can now compile the code.

I installed a fresh version of Keil uVision 5.39 and selected ARM:CMSIS v6.0.0 from the Software packs. Additionally, I had to select the recent version of ARM:CMSIS-RTX in the the Software packs.

For some reason, the OSWrappers.cpp file in TouchGFX\target\generated wasn't updated after regenerating the code  with TouchGFXDesigner 4.23.2, so I had to manually include:

#include <cassert>

After doing so, the error was resolved.