2025-07-09 12:08 PM
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!
2025-07-09 5:28 PM
upload your IOC file.
2025-07-09 8:28 PM
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.
2025-07-09 11:08 PM
2025-07-09 11:08 PM
I generated the code via the code generator in CubeMX
2025-07-10 12:59 AM
I mean I included all modules I need from the .ioc file and added the Drivers folder so the library is there when I add a new module via .ioc. But all the includes are there without I needed to manually include any file.
Do you know if the Driver library can be included by the CubeMX ?
2025-07-10 5:37 AM
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.
2025-07-10 9:03 PM
You should only ever include the file I wrote above.
If you need other modules, enable them in the "*_hal_conf.h" file.
> I just noticed I have include file #include "stm32u5xx_hal_adc.h"
This is the problem.