[Solved] error:#20: identifier “HAL_StatusTypeDef“ is undefined.

There are 30 errors during editing. The errors are: error: #20: identifier “hal_statustypedef” is undefined. After checking, all required Hal_Statustypedef files contain #include “stm32f4xx_hal_def.H”, which is contained in the options for target C/C + + inclusion path.

Rivers/CMSIS/device/St/stm32f4xx/include, and find stm32f4xx in the folder_hal_Def.H, which can also be seen in the compiled project.

Solution:

This problem is quite common. Basically, such an alarm occurs only when you add your own C file. Just add #include “stm32f0xx_hal.H” at the beginning of your own C file. Note that it is the beginning.

Read More: