Skip to main content
Associate II
Jul 16, 2025 12:40 PM UTC
Solved

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

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.
TDK
TDKBest answer
Jul 16, 2025 1:21 PM UTC

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

2 replies

TDK
TDKBest answer
Jul 16, 2025 1:21 PM UTC

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
Jul 16, 2025 1:45 PM UTC

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.