cancel
Showing results for 
Search instead for 
Did you mean: 

Error, unknown type name 'HAL_StatusTypeDef' with Drivers files

GTanova
Associate II

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!

7 REPLIES 7
Karl Yamashita
Principal

upload your IOC file.

I was told that if a devices starts to smoke, put the smoke back in. I guess I never got all the smoke because the device never worked afterwards.
Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.
TDK
Super User

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".

There it is.

I generated the code via the code generator in CubeMX

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 ?

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. 

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.

If you feel a post has answered your question, please click "Accept as Solution".