cancel
Showing results for 
Search instead for 
Did you mean: 

Uint16_t Build Errors within STM32CubeIDE 12.1

AEng7
Associate II

Hey ST Community, 

I started getting errors within STM32CubeIDE, throughout all workbenches randomly, after working on a new project.

The errors involve uint16_t,  such as:

-'error: unknown type name "uint16_t''

-"error: unknown type name 'uint16_t'; did you mean 'int16_t'?' etc"

-"error: 'uint16_t' undeclared (first use in this function); did you mean 'int16_t'?" 

Seems like the errors are within the CMSIS and STM32H7xx_HAL_Driver files. For example, adding '#include <stdint.h>' to 'stm32h7xx_hal_gpio.h', does not seem to fix the errors as suggested by similar problems encountered in the STM community. 

I am wondering if this is a compiler or driver issue within STM32. 

Before working on the new project, I had no Build/compile issues. Reverting the project to a previous version which did build with no errors did not fix it.

 

Thank you for any suggestions that will fix this. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

I reinstalled the program and it fixed the problem, so definitely was an environmental problem. 

stdint.h must have been damaged as you suggested. 

 

Thanks for the suggestions and the support. 

View solution in original post

7 REPLIES 7
Andrew Neil
Evangelist III

@AEng7 wrote:

The errors involve uint16_t,  such as:

-'error: unknown type name "uint16_t''

-"error: unknown type name 'uint16_t'; did you mean 'int16_t'?' etc"

-"error: 'uint16_t' undeclared (first use in this function); did you mean 'int16_t'?" 


They certainly suggest that #include <stdint.h> is missing.

Try adding  #include <stdint.h>  as the very first #include - before everything else ...

Thanks for the suggestion Andrew - this didn't work unfortunately 

 

Even if you put the   #include <stdint.h>  as the very first  #include - before everything else in your .c file(s)?

AEng7
Associate II

I will try doing that in all the .cpp files and see if that works thanks

I have tried it will all the STM driver files that are now bringing up errors and didn't fix it.

Pavel A.
Evangelist III

 For example, adding '#include <stdint.h>' to 'stm32h7xx_hal_gpio.h', 

Normally the ST library header files and CMSIS pull in stdint.h properly, so these errors should never occur.

Something is bad in your environment, stdint,h is damaged, CubeIDE is installed in path containing weird characters...

* Import some small example for your MCU/board (using the CubeIDE import example tool) and build it.

* Install CubeIDE on a clean machine with supported OS (not Windows 7 or exotic Linux version)

I reinstalled the program and it fixed the problem, so definitely was an environmental problem. 

stdint.h must have been damaged as you suggested. 

 

Thanks for the suggestions and the support.