Home > database >  VSCode marks GPIO_TypeDef in HAL library as unknown
VSCode marks GPIO_TypeDef in HAL library as unknown

Time:02-04

I have some functions that refer to GPIO_TypeDef struct from STM32_HAL library and in Keil I recieve no errors in compilation, but VSCode marks it as "unknown identificator" error. I fixed it with adding

#include "stm32f103xe.h"

to main.hand both Keil and VScode now take it with no problems, but maybe I had to change something in VSCode settings to fix that problem.

CodePudding user response:

I found answer in CubeIDE directives. Add theese to C_Cpp.default.defines (You can simply do this through Settings->Extensions->C/C ->Defines)

__CC_ARM
STM32F1xx
USE_HAL_DRIVER
STM32F103xE
DEBUG
  •  Tags:  
  • Related