Skip to main content
Associate 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
  • 271 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

 

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

TDK
TDKBest answer
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.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Andrew Neil
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

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.