Skip to main content
Visitor II
July 16, 2025
Solved

Some files in the HAL_Driver and CMSIS libraries are causing errors when creating a C++ project

  • July 16, 2025
  • 2 replies
  • 270 views

I am receiving errors such as 'HAL_StatusTypeDef' does not name a type; did you mean 'NOR_StatusTypedef'?' and 'HAL_LockTypeDef' does not name a type' in my files in STM32F4xx_HAL_Driver/Inc . i create project automatically with stm32CubeIDE. What causes these errors?Thanks

studentof_0-1752669414934.pngstudentof_1-1752669447993.png

 

    This topic has been closed for replies.
    Best answer by TDK

    Typically, this happens when you include a file other than stm32f4xx_hal.h, which is the only file you should be including from user code.

    If you correct that and are still having problem, show the full output of the Console tab.

     

    If this is all code generated directly from CubeMX, include the IOC file so the error can be duplicated.

    2 replies

    TDKAnswer
    Super User
    July 16, 2025

    Typically, this happens when you include a file other than stm32f4xx_hal.h, which is the only file you should be including from user code.

    If you correct that and are still having problem, show the full output of the Console tab.

     

    If this is all code generated directly from CubeMX, include the IOC file so the error can be duplicated.

    Super User
    July 16, 2025

    Welcome to the forum.

    For best results, please see How to write your question to maximize your chances to find a solution

    You haven't said what version of stm32CubeIDE