OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 1063|回复: 3

按照PDF教程新建工程为什么会出现这种情况呢

[复制链接]

1

主题

1

帖子

0

精华

新手入门

积分
12
金钱
12
注册时间
2022-8-21
在线时间
1 小时
发表于 2022-8-24 23:20:59 | 显示全部楼层 |阅读模式
1金钱
*** Using Compiler 'V5.06 update 3 (build 300)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'Build target 'Template'
compiling main.c...
main.c(15): error:  #20: identifier "GPIO_InitTypeDef" is undefined
          GPIO_InitTypeDef GPIO_Initure;
main.c(17): warning:  #223-D: function "HAL_Init" declared implicitly
      HAL_Init();      
main.c(18): warning:  #223-D: function "Stm32_Clock_Init" declared implicitly
      Stm32_Clock_Init(RCC_PLL_MUL9);
main.c(18): error:  #20: identifier "RCC_PLL_MUL9" is undefined
      Stm32_Clock_Init(RCC_PLL_MUL9);
main.c(20): warning:  #223-D: function "__HAL_RCC_GPIOA_CLK_ENABLE" declared implicitly
      __HAL_RCC_GPIOA_CLK_ENABLE();                 
main.c(21): warning:  #223-D: function "__HAL_RCC_GPIOD_CLK_ENABLE" declared implicitly
            __HAL_RCC_GPIOD_CLK_ENABLE();                
main.c(23): error:  #20: identifier "GPIO_PIN_8" is undefined
      GPIO_Initure.Pin=GPIO_PIN_8;                                 //PA8
main.c(24): error:  #20: identifier "GPIO_MODE_OUTPUT_PP" is undefined
      GPIO_Initure.Mode=GPIO_MODE_OUTPUT_PP;         
main.c(25): error:  #20: identifier "GPIO_PULLUP" is undefined
      GPIO_Initure.Pull=GPIO_PULLUP;                 
main.c(26): error:  #20: identifier "GPIO_SPEED_FREQ_HIGH" is undefined
      GPIO_Initure.Speed=GPIO_SPEED_FREQ_HIGH;   
main.c(27): warning:  #223-D: function "HAL_GPIO_Init" declared implicitly
      HAL_GPIO_Init(GPIOA,&GPIO_Initure);
main.c(29): error:  #20: identifier "GPIO_PIN_2" is undefined
          GPIO_Initure.Pin=GPIO_PIN_2;                                 //PD2
main.c(34): warning:  #223-D: function "HAL_GPIO_WritePin" declared implicitly
                  HAL_GPIO_WritePin(GPIOA,GPIO_PIN_8,GPIO_PIN_SET);                 
main.c(34): error:  #20: identifier "GPIO_PIN_SET" is undefined
                  HAL_GPIO_WritePin(
PIOA,GPIO_PIN_8,GPIO_PIN_SET);                 
main.c(37): error:  #20: identifier "GPIO_PIN_RESET" is undefined
                  HAL_GPIO_WritePin(
PIOA,GPIO_PIN_8,GPIO_PIN_RESET);               
main.c: 6 warnings, 9 errors
compiling usart.c...
..\SYSTEM\usart\usart.c(75): error:  #20: identifier "GPIO_InitTypeDef" is undefined
    GPIO_InitTypeDef GPIO_InitStructure;
..\SYSTEM\usart\usart.c(76): error:  #20: identifier "USART_InitTypeDef" is undefined
          USART_InitTypeDef USART_InitStructure;
..\SYSTEM\usart\usart.c(77): error:  #20: identifier "NVIC_InitTypeDef" is undefined
          NVIC_InitTypeDef NVIC_InitStructure;
..\SYSTEM\usart\usart.c(79): warning:  #223-D: function "RCC_APB2PeriphClockCmd" declared implicitly
          RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE);        //使??USART1,GPIOA时??
..\SYSTEM\usart\usart.c(79): error:  #20: identifier "RCC_APB2Periph_USART1" is undefined
          RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE);        //使??USART1,GPIOA时??
..\SYSTEM\usart\usart.c(79): error:  #20: identifier "RCC_APB2Periph_GPIOA" is undefined
          RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE);        //使??USART1,GPIOA时??
..\SYSTEM\usart\usart.c(82): error:  #20: identifier "GPIO_Pin_9" is undefined
    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; //PA.9
..\SYSTEM\usart\usart.c(83): error:  #20: identifier "GPIO_Speed_50MHz" is undefined
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
..\SYSTEM\usart\usart.c(84): error:  #20: identifier "GPIO_Mode_AF_PP" is undefined
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;        //复???????涑?
..\SYSTEM\usart\usart.c(85): warning:  #223-D: function "GPIO_Init" declared implicitly
    GPIO_Init(GPIOA, &GPIO_InitStructure);//??始化GPIOA.9
..\SYSTEM\usart\usart.c(88): error:  #20: identifier "GPIO_Pin_10" is undefined
    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;//PA10
..\SYSTEM\usart\usart.c(89): error:  #20: identifier "GPIO_Mode_IN_FLOATING" is undefined
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;//浮??????
..\SYSTEM\usart\usart.c(97): warning:  #223-D: function "NVIC_Init" declared implicitly
          NVIC_Init(&NVIC_InitStructure);        //??指定?牟???始化VIC?拇???
..\SYSTEM\usart\usart.c(102): error:  #20: identifier "USART_WordLength_8b" is undefined
          USART_InitStructure.USART_WordLength = USART_WordLength_8b;//?殖?为8位?莞?式
..\SYSTEM\usart\usart.c(103): error:  #20: identifier "USART_StopBits_1" is undefined
          USART_InitStructure.USART_StopBits = USART_StopBits_1;//一??停止位
..\SYSTEM\usart\usart.c(104): error:  #20: identifier "USART_Parity_No" is undefined
          USART_InitStructure.USART_Parity = USART_Parity_No;//????偶校??位
..\SYSTEM\usart\usart.c(105): error:  #20: identifier "USART_HardwareFlowControl_None" is undefined
          USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;//??硬?????骺???
..\SYSTEM\usart\usart.c(106): error:  #20: identifier "USART_Mode_Rx" is undefined
          USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;        //?辗?模式
..\SYSTEM\usart\usart.c(106): error:  #20: identifier "USART_Mode_Tx" is undefined
          USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;        //?辗?模式
..\SYSTEM\usart\usart.c(108): warning:  #223-D: function "USART_Init" declared implicitly
    USART_Init(USART1, &USART_InitStructure); //??始化串??1
..\SYSTEM\usart\usart.c(109): warning:  #223-D: function "USART_ITConfig" declared implicitly
    USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);//开?舸诮????卸?
..\SYSTEM\usart\usart.c(109): error:  #20: identifier "USART_IT_RXNE" is undefined
    USART_ITConfig(
SART1, USART_IT_RXNE, ENABLE);//开?舸诮????卸?
..\SYSTEM\usart\usart.c(110): warning:  #223-D: function "USART_Cmd" declared implicitly
    USART_Cmd(USART1, ENABLE);                    //使?艽?1
..\SYSTEM\usart\usart.c(120): warning:  #223-D: function "USART_GetITStatus" declared implicitly
          if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)  //?????卸?(???盏降??荼?????0x0d 0x0a??尾)
..\SYSTEM\usart\usart.c(120): error:  #20: identifier "USART_IT_RXNE" is undefined
          if(USART_GetITStatus(
SART1, USART_IT_RXNE) != RESET)  //?????卸?(???盏降??荼?????0x0d 0x0a??尾)
..\SYSTEM\usart\usart.c(122): warning:  #223-D: function "USART_ReceiveData" declared implicitly
                  Res =USART_ReceiveData(USART1);        //??取???盏降???
..\SYSTEM\usart\usart.c: 8 warnings, 18 errors
compiling delay.c...
..\SYSTEM\delay\delay.c(133): warning:  #223-D: function "SysTick_CLKSourceConfig" declared implicitly
          SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK_Div8);        //选???獠?时??  HCLK/8
..\SYSTEM\delay\delay.c(133): error:  #20: identifier "SysTick_CLKSource_HCLK_Div8" is undefined
          SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK_Div8);        //选???獠?时??  HCLK/8
..\SYSTEM\delay\delay.c: 1 warning, 1 error
compiling stm32f1xx_it.c...
main.h(26): error:  #5: cannot open source input file "stm3210e_eval.h": No such file or directory
  #include "stm3210e_eval.h"
stm32f1xx_it.c: 0 warnings, 1 error
compiling stm32f1xx_hal_msp.c...
main.h(26): error:  #5: cannot open source input file "stm3210e_eval.h": No such file or directory
  #include "stm3210e_eval.h"
stm32f1xx_hal_msp.c: 0 warnings, 1 error
compiling stm32f1xx_hal_rcc_ex.c...
..\HALLIB\Src\stm32f1xx_hal_rcc_ex.c(116): error:  #268: declaration may not appear after executable statement in block
      FlagStatus       pwrclkchanged = RESET;
..\HALLIB\Src\stm32f1xx_hal_rcc_ex.c: 0 warnings, 1 error
"..\OBJ\TEMPATE.axf" - 31 Error(s), 15 Warning(s).
Target not created.
Build Time Elapsed:  00:00:02


正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165371
金钱
165371
注册时间
2010-12-1
在线时间
2110 小时
发表于 2022-8-26 00:43:03 | 显示全部楼层
从第一个错误开始改起。。。
回复

使用道具 举报

109

主题

5564

帖子

0

精华

资深版主

Rank: 8Rank: 8

积分
10561
金钱
10561
注册时间
2017-2-18
在线时间
1911 小时
发表于 2022-8-31 13:24:23 | 显示全部楼层
ST官方头文件未声明或未添加到工程
回复

使用道具 举报

0

主题

12

帖子

0

精华

初级会员

Rank: 2

积分
63
金钱
63
注册时间
2021-12-12
在线时间
10 小时
发表于 2022-9-3 12:39:34 | 显示全部楼层
相关头文件没有包含 相关头文件的路径没有添加
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-2-26 03:59

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表