OpenEdv-开源电子网

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

用的原子哥的开发资料,试了很多次还是有这23个错误orz...为什么?

[复制链接]

5

主题

13

帖子

0

精华

初级会员

Rank: 2

积分
74
金钱
74
注册时间
2015-5-2
在线时间
5 小时
发表于 2015-5-2 20:11:25 | 显示全部楼层 |阅读模式
5金钱
E:\MDK5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.4\Device\Include\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  } IRQn_Type;
..\SYSTEM\usart\usart.c(93): error:  #20: identifier "GPIO_InitTypeDef" is undefined
      GPIO_InitTypeDef GPIO_InitStructure;
..\SYSTEM\usart\usart.c(94): error:  #20: identifier "USART_InitTypeDef" is undefined
        USART_InitTypeDef USART_InitStructure;
..\SYSTEM\usart\usart.c(95): error:  #20: identifier "NVIC_InitTypeDef" is undefined
        NVIC_InitTypeDef NVIC_InitStructure;
..\SYSTEM\usart\usart.c(97): warning:  #223-D: function "RCC_APB2PeriphClockCmd" declared implicitly
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE);     //使能USART1,GPIOA时钟
..\SYSTEM\usart\usart.c(97): error:  #20: identifier "RCC_APB2Periph_USART1" is undefined
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE);     //使能USART1,GPIOA时钟
..\SYSTEM\usart\usart.c(97): error:  #20: identifier "RCC_APB2Periph_GPIOA" is undefined
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE);     //使能USART1,GPIOA时钟
..\SYSTEM\usart\usart.c(98): warning:  #223-D: function "USART_DeInit" declared implicitly
        USART_DeInit(USART1);  //复位串口1
..\SYSTEM\usart\usart.c(100): error:  #20: identifier "GPIO_Pin_9" is undefined
      GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; //PA.9
..\SYSTEM\usart\usart.c(101): error:  #20: identifier "GPIO_Speed_50MHz" is undefined
      GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
..\SYSTEM\usart\usart.c(102): error:  #20: identifier "GPIO_Mode_AF_PP" is undefined
      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;   //复用推挽输出
..\SYSTEM\usart\usart.c(103): warning:  #223-D: function "GPIO_Init" declared implicitly
      GPIO_Init(GPIOA, &GPIO_InitStructure); //初始化PA9
..\SYSTEM\usart\usart.c(106): error:  #20: identifier "GPIO_Pin_10" is undefined
      GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
..\SYSTEM\usart\usart.c(107): error:  #20: identifier "GPIO_Mode_IN_FLOATING" is undefined
      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;//浮空输入
..\SYSTEM\usart\usart.c(116): warning:  #223-D: function "NVIC_Init" declared implicitly
        NVIC_Init(&NVIC_InitStructure); //根据指定的参数初始化VIC寄存器
..\SYSTEM\usart\usart.c(121): error:  #20: identifier "USART_WordLength_8b" is undefined
        USART_InitStructure.USART_WordLength = USART_WordLength_8b;//字长为8位数据格式
..\SYSTEM\usart\usart.c(122): error:  #20: identifier "USART_StopBits_1" is undefined
        USART_InitStructure.USART_StopBits = USART_StopBits_1;//一个停止位
..\SYSTEM\usart\usart.c(123): error:  #20: identifier "USART_Parity_No" is undefined
        USART_InitStructure.USART_Parity = USART_Parity_No;//无奇偶校验位
..\SYSTEM\usart\usart.c(124): error:  #20: identifier "USART_HardwareFlowControl_None" is undefined
        USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;//无硬件数据流控制
..\SYSTEM\usart\usart.c(125): error:  #20: identifier "USART_Mode_Rx" is undefined
        USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //收发模式
..\SYSTEM\usart\usart.c(125): error:  #20: identifier "USART_Mode_Tx" is undefined
        USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //收发模式
..\SYSTEM\usart\usart.c(127): warning:  #223-D: function "USART_Init" declared implicitly
      USART_Init(USART1, &USART_InitStructure); //初始化串口
..\SYSTEM\usart\usart.c(128): warning:  #223-D: function "USART_ITConfig" declared implicitly
      USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);//开启中断
..\SYSTEM\usart\usart.c(128): error:  #20: identifier "USART_IT_RXNE" is undefined
      USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);//开启中断
..\SYSTEM\usart\usart.c(129): warning:  #223-D: function "USART_Cmd" declared implicitly
      USART_Cmd(USART1, ENABLE);                    //使能串口 
..\SYSTEM\usart\usart.c(139): warning:  #223-D: function "USART_GetITStatus" declared implicitly
        if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)  //接收中断(接收到的数据必须是0x0d 0x0a结尾)
..\SYSTEM\usart\usart.c(139): error:  #20: identifier "USART_IT_RXNE" is undefined
        if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)  //接收中断(接收到的数据必须是0x0d 0x0a结尾)
..\SYSTEM\usart\usart.c(141): warning:  #223-D: function "USART_ReceiveData" declared implicitly
                Res =USART_ReceiveData(USART1);//(USART1->DR);  //读取接收到的数据
..\SYSTEM\usart\usart.c: 10 warnings, 19 errors
compiling sys.c...
E:\MDK5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.4\Device\Include\stm32f10x.h(298): error:  #67: expected a "}"
    ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
E:\MDK5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.4\Device\Include\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  } IRQn_Type;
..\SYSTEM\sys\sys.c(18): warning:  #223-D: function "NVIC_PriorityGroupConfig" declared implicitly
      NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);   //设置NVIC中断分组2:2位抢占优先级,2位响应优先级
..\SYSTEM\sys\sys.c(18): error:  #20: identifier "NVIC_PriorityGroup_2" is undefined
      NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);   //设置NVIC中断分组2:2位抢占优先级,2位响应优先级
..\SYSTEM\sys\sys.c: 2 warnings, 2 errors
compiling delay.c...
E:\MDK5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.4\Device\Include\stm32f10x.h(298): error:  #67: expected a "}"
    ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
E:\MDK5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.4\Device\Include\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  } IRQn_Type;
..\SYSTEM\delay\delay.c(60): warning:  #223-D: function "SysTick_CLKSourceConfig" declared implicitly
        SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK_Div8);   //选择外部时钟  HCLK/8
..\SYSTEM\delay\delay.c(60): error:  #20: identifier "SysTick_CLKSource_HCLK_Div8" is undefined
        SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK_Div8);   //选择外部时钟  HCLK/8
..\SYSTEM\delay\delay.c: 2 warnings, 2 errors
compiling TEST.c...
"..\OUTPUT\test.axf" - 23 Error(s), 14 Warning(s).
Target not created

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

使用道具 举报

88

主题

7377

帖子

5

精华

资深版主

Rank: 8Rank: 8

积分
14980
金钱
14980
注册时间
2013-11-13
在线时间
1823 小时
发表于 2015-5-3 20:02:03 | 显示全部楼层
对应的外设的库没有添加进来,或者相应的头文件路径没添加
开往春天的手扶拖拉机
回复

使用道具 举报

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

本版积分规则



关闭

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

正点原子公众号

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

GMT+8, 2025-6-22 22:29

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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