Home > other >  Beginners written in keil5 stm32 template application error for a great god to reassure?
Beginners written in keil5 stm32 template application error for a great god to reassure?

Time:10-02





Error information below
The compiling. The main c...
The main c (5) : error: # 20: identifier "GPIO_InitTypeDef" is undefined
GPIO_InitTypeDef GPIO_InitStructure;
The main c (6) : warning: # 223 - D: the function "RCC_APB2PeriphClockCmd" declared implicitly
RCC_APB2PeriphClockCmd (RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOE, ENABLE);//?? PE, PE??????
The main c (6) : error: # 20: identifier "RCC_APB2Periph_GPIOB" is undefined
RCC_APB2PeriphClockCmd (RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOE, ENABLE);//?? PE, PE??????
The main c (6) : error: # 20: identifier "RCC_APB2Periph_GPIOE" is undefined
RCC_APB2PeriphClockCmd (RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOE, ENABLE);//?? PE, PE??????
The main c (8) : error: # 20: identifier "GPIO_Pin_5" is undefined
GPIO_InitStructure. GPIO_Pin=GPIO_Pin_5;//LED0 - & gt; PB. 5??????
The main c (9) : error: # 20: identifier "GPIO_Mode_Out_PP" is undefined
GPIO_InitStructure. GPIO_Mode=GPIO_Mode_Out_PP;//??????
The main c (10) : error: # 20: identifier "GPIO_Speed_50MHz" is undefined
GPIO_InitStructure. GPIO_Speed=GPIO_Speed_50MHz;//IO?????? 50 MHZ
The main c (11) : warning: # 223 - D: the function "GPTIO_Init" declared implicitly
GPTIO_Init (GPTIOB, & amp; GPIO_InitStructure);//????????????? GPIO. 5
The main c (11) : error: # 20: identifier "GPTIOB" is undefined
GPTIO_Init (GPTIOB, & amp; GPIO_InitStructure);//????????????? GPIO. 5
The main c (12) : warning: # 223 - D: the function "GPIO_SetBits" declared implicitly
GPIO_SetBits (GPIOB, GPIO_Pin_5);//PB. 5???
Main. C (14) : error: # 20: identifier "GPTIO_InitStructure" is undefined
GPTIO_InitStructure. GPIO_Pin=GPIO_Pin_5;//LED0 - & gt; PB. 5?????? ????
The main c (15) : error: # 20: identifier "GPTIOE" is undefined
GPTIO_Init (GPTIOE, & amp; GPIO_InitStructure);//?????? , IO?????? 50 MHZ
The main c (19) : warning: # 223 - D: the function "GPIO_ResetBits" declared implicitly
GPIO_ResetBits (GPIOB, GPIO_Pin_5);
The main c (21) : warning: # 223 - D: the function "Delay" declared implicitly
Delay (3000000);
Main. C: 5 warnings, errors of 9
".. \ OBJ \ Template axf - 9 "Error (s), 5 Warning (s).
Target not created.
The Build Time Elapsed: 00:00:01

CodePudding user response:

# include "stm32f10x_gpio. H"
This header file

CodePudding user response:

Upstairs positive solution, open stm32f10x. H see # include "stm32f10x_gpio. H" are blocked, if not, see if there are stm32f10x_gpio engineering. C

CodePudding user response:

Add engineering standard library, can be all copy directory to add in, and then find the configuration file, all the library files or need to uncomment, compile head is added in the project file path to the next layer, it is good, with HAL library to use cubeMX configuration as far as possible, convenient, and can quickly into the order

CodePudding user response:

I think may be not only lack of header files, you are using a library function configuration method, must want to have to use standard library, you can write a GPIO_Init (); Then jump once, see if there are any standard library functions, if you have, it is good that after adding the corresponding header file,

CodePudding user response:

The elder brothers, your problem solved
  • Related