cancel
Showing results for 
Search instead for 
Did you mean: 

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

studentof
Visitor

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

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

View solution in original post

2 REPLIES 2
TDK
Super User

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

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.