Skip to main content
Associate III
Jul 9, 2025 7:08 PM UTC
Question

Error, unknown type name 'HAL_StatusTypeDef' with Drivers files

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!

This topic has been closed for replies.

7 replies

Karl Yamashita
Principal
Jul 10, 2025 12:28 AM UTC

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
Jul 10, 2025 6:08 AM UTC

There it is.

GTanovaAuthor
Associate III
Jul 10, 2025 12:37 PM UTC

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
Jul 10, 2025 3:28 AM UTC

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
Jul 10, 2025 6:08 AM UTC

I generated the code via the code generator in CubeMX