Skip to main content
Graduate
July 9, 2025
Question

Error, unknown type name 'HAL_StatusTypeDef' with Drivers files

  • July 9, 2025
  • 2 replies
  • 496 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!

    This topic has been closed for replies.

    2 replies

    Graduate II
    July 10, 2025

    upload your IOC file.

    GTanovaAuthor
    Graduate
    July 10, 2025

    There it is.

    GTanovaAuthor
    Graduate
    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. 

    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.

    GTanovaAuthor
    Graduate
    July 10, 2025

    I generated the code via the code generator in CubeMX