Skip to main content
Associate III
July 9, 2025
Question

Error, unknown type name 'HAL_StatusTypeDef' with Drivers files

  • July 9, 2025
  • 2 replies
  • 497 views

I get errors in many of the headers files in the Drivers, for: unknown type name 'HAL_StatusTypeDef'. All of these files include the file with definitions, in my case #include "stm32u5xx_hal_def.h",  so I do not understand why it is a problem to find. I have all necessary include paths. When I searched on the internet I see that others had the same issue but did not get any good solution. Do you have any tips why it happens and how can I solve it?

Thanks in advance!

2 replies

Karl Yamashita
Principal
July 10, 2025

upload your IOC file.

If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source
GTanovaAuthor
Associate III
July 10, 2025

There it is.

GTanovaAuthor
Associate III
July 10, 2025

I just noticed I have include file #include "stm32u5xx_hal_adc.h" instead of adc.h in one of my application files where I define an adc1 instance. I think this was causing the error. But interesting that this file adc.h, situated under Core/Inc,  contains only ADC_Init function declaration and the rest of the ADC related functions are in the hal_adc source file which is situated in the Drivers folder. Do you know if it should be like that? I guess it is the Cube IDE placing them there. 

TDK
Super User
July 10, 2025

This is an issue when you include files in an incorrect manner.

Your user file should only include "stm32u5xx_hal.h". Other files are included from within there. CubeMX generated code does this correctly.

"If you feel a post has answered your question, please click ""Accept as Solution""."
GTanovaAuthor
Associate III
July 10, 2025

I generated the code via the code generator in CubeMX