Uint16_t Build Errors within STM32CubeIDE 12.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-26 3:01 AM - edited ‎2024-06-26 3:02 AM
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.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-27 2:07 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-26 3:45 AM
@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 ...
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-26 4:09 AM
Thanks for the suggestion Andrew - this didn't work unfortunately
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-26 4:24 AM
Even if you put the #include <stdint.h> as the very first #include - before everything else in your .c file(s)?
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-26 5:18 AM
I will try doing that in all the .cpp files and see if that works thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-26 5:19 AM
I have tried it will all the STM driver files that are now bringing up errors and didn't fix it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-26 6:01 AM
> 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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-27 2:07 AM
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.
