OpenEdv-开源电子网

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

用了源文件里的代码,完整地做下来,一直报错,好像是misc.h头文件未囊括,但已经导入了

[复制链接]

1

主题

3

帖子

0

精华

新手上路

积分
25
金钱
25
注册时间
2019-7-14
在线时间
4 小时
发表于 2019-7-14 21:02:15 | 显示全部楼层 |阅读模式
1金钱
请大家帮我看下,我烦恼了好久,搞不懂问题在哪,谢谢大家!!!



Build target 'LED'
compiling led.c...
..\HAREWARE\LED\led.c(21): error:  #20: identifier "GPIO_InitTypeDef" is undefined
   GPIO_InitTypeDef  GPIO_InitStructure;
..\HAREWARE\LED\led.c(23): warning:  #223-D: function "RCC_APB2PeriphClockCmd" declared implicitly
   RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOE, ENABLE);    //??PB,PE????
..\HAREWARE\LED\led.c(23): error:  #20: identifier "RCC_APB2Periph_GPIOB" is undefined
   RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOE, ENABLE);    //??PB,PE????
..\HAREWARE\LED\led.c(23): error:  #20: identifier "RCC_APB2Periph_GPIOE" is undefined
   RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOE, ENABLE);    //??PB,PE????
..\HAREWARE\LED\led.c(25): error:  #20: identifier "GPIO_Pin_5" is undefined
   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;                             //LED0-->B.5 ????
..\HAREWARE\LED\led.c(26): error:  #20: identifier "GPIO_Mode_Out_PP" is undefined
   GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;              //????
..\HAREWARE\LED\led.c(27): error:  #20: identifier "GPIO_Speed_50MHz" is undefined
   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;             //IO????50MHz
..\HAREWARE\LED\led.c(28): warning:  #223-D: function "GPIO_Init" declared implicitly
   GPIO_Init(GPIOB, &GPIO_InitStructure);                                        //?????????GPIOB.5
..\HAREWARE\LED\led.c(29): warning:  #223-D: function "GPIO_SetBits" declared implicitly
   GPIO_SetBits(GPIOB,GPIO_Pin_5);                                               //PB.5 ???
..\HAREWARE\LED\led.c(35): warning:  #1-D: last line of file ends without a newline

..\HAREWARE\LED\led.c: 4 warnings, 6 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 usart.c...
..\SYSTEM\usart\usart.c(91): error:  #20: identifier "GPIO_InitTypeDef" is undefined
    GPIO_InitTypeDef GPIO_InitStructure;
..\SYSTEM\usart\usart.c(92): error:  #20: identifier "USART_InitTypeDef" is undefined
        USART_InitTypeDef USART_InitStructure;
..\SYSTEM\usart\usart.c(93): error:  #20: identifier "NVIC_InitTypeDef" is undefined
        NVIC_InitTypeDef NVIC_InitStructure;
..\SYSTEM\usart\usart.c(95): warning:  #223-D: function "RCC_APB2PeriphClockCmd" declared implicitly
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE);     //使能USART1,GPIOA时钟
..\SYSTEM\usart\usart.c(95): error:  #20: identifier "RCC_APB2Periph_USART1" is undefined
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE);     //使能USART1,GPIOA时钟
..\SYSTEM\usart\usart.c(95): error:  #20: identifier "RCC_APB2Periph_GPIOA" is undefined
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE);     //使能USART1,GPIOA时钟
..\SYSTEM\usart\usart.c(98): error:  #20: identifier "GPIO_Pin_9" is undefined
    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; //PA.9
..\SYSTEM\usart\usart.c(99): error:  #20: identifier "GPIO_Speed_50MHz" is undefined
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
..\SYSTEM\usart\usart.c(100): error:  #20: identifier "GPIO_Mode_AF_PP" is undefined
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;     //复用推挽输出
..\SYSTEM\usart\usart.c(101): warning:  #223-D: function "GPIO_Init" declared implicitly
    GPIO_Init(GPIOA, &GPIO_InitStructure);//初始化GPIOA.9
..\SYSTEM\usart\usart.c(104): error:  #20: identifier "GPIO_Pin_10" is undefined
    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;//PA10
..\SYSTEM\usart\usart.c(105): error:  #20: identifier "GPIO_Mode_IN_FLOATING" is undefined
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;//浮空输入
..\SYSTEM\usart\usart.c(113): warning:  #223-D: function "NVIC_Init" declared implicitly
        NVIC_Init(&NVIC_InitStructure); //根据指定的参数初始化VIC寄存器
..\SYSTEM\usart\usart.c(118): error:  #20: identifier "USART_WordLength_8b" is undefined
        USART_InitStructure.USART_WordLength = USART_WordLength_8b;//字长为8位数据格式
..\SYSTEM\usart\usart.c(119): error:  #20: identifier "USART_StopBits_1" is undefined
        USART_InitStructure.USART_StopBits = USART_StopBits_1;//一个停止位
..\SYSTEM\usart\usart.c(120): error:  #20: identifier "USART_Parity_No" is undefined
        USART_InitStructure.USART_Parity = USART_Parity_No;//无奇偶校验位
..\SYSTEM\usart\usart.c(121): error:  #20: identifier "USART_HardwareFlowControl_None" is undefined
        USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;//无硬件数据流控制
..\SYSTEM\usart\usart.c(122): error:  #20: identifier "USART_Mode_Rx" is undefined
        USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //收发模式
..\SYSTEM\usart\usart.c(122): error:  #20: identifier "USART_Mode_Tx" is undefined
        USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //收发模式
..\SYSTEM\usart\usart.c(124): warning:  #223-D: function "USART_Init" declared implicitly
    USART_Init(USART1, &USART_InitStructure); //初始化串口1
..\SYSTEM\usart\usart.c(125): warning:  #223-D: function "USART_ITConfig" declared implicitly
    USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);//开启串口接受中断
..\SYSTEM\usart\usart.c(125): error:  #20: identifier "USART_IT_RXNE" is undefined
    USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);//开启串口接受中断
..\SYSTEM\usart\usart.c(126): warning:  #223-D: function "USART_Cmd" declared implicitly
    USART_Cmd(USART1, ENABLE);                    //使能串口1
..\SYSTEM\usart\usart.c(136): warning:  #223-D: function "USART_GetITStatus" declared implicitly
        if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)  //接收中断(接收到的数据必须是0x0d 0x0a结尾)
..\SYSTEM\usart\usart.c(136): error:  #20: identifier "USART_IT_RXNE" is undefined
        if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)  //接收中断(接收到的数据必须是0x0d 0x0a结尾)
..\SYSTEM\usart\usart.c(138): warning:  #223-D: function "USART_ReceiveData" declared implicitly
                Res =USART_ReceiveData(USART1); //读取接收到的数据
..\SYSTEM\usart\usart.c: 8 warnings, 18 errors
"..\OBJ\LED.axf" - 25 Error(s), 13 Warning(s).
Target not created.
Build Time Elapsed:  00:00:04


LED.rar

2.68 MB, 下载次数: 2

最佳答案

查看完整内容[请看2#楼]

哦,找到问题,是我后面手打STM32F10X_HD,USE_STDPERIPH_DRIVER这段打错字了,不好意思,犯了这么低级的错误,麻烦了
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

1

主题

3

帖子

0

精华

新手上路

积分
25
金钱
25
注册时间
2019-7-14
在线时间
4 小时
 楼主| 发表于 2019-7-14 21:02:16 | 显示全部楼层
台风天渡劫 发表于 2019-7-15 09:23
我做了2个实验了,一开始没问题,做到按键实验的时候开始不对,步骤是按照教程来的,程序代码也是直接复 ...

哦,找到问题,是我后面手打STM32F10X_HD,USE_STDPERIPH_DRIVER这段打错字了,不好意思,犯了这么低级的错误,麻烦了
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165536
金钱
165536
注册时间
2010-12-1
在线时间
2117 小时
发表于 2019-7-15 01:43:08 | 显示全部楼层
自己改,学习我们的新建工程例程先
回复

使用道具 举报

1

主题

3

帖子

0

精华

新手上路

积分
25
金钱
25
注册时间
2019-7-14
在线时间
4 小时
 楼主| 发表于 2019-7-15 09:23:55 | 显示全部楼层
正点原子 发表于 2019-7-15 01:43
自己改,学习我们的新建工程例程先

我做了2个实验了,一开始没问题,做到按键实验的时候开始不对,步骤是按照教程来的,程序代码也是直接复制源代码的,感觉就是头文件加不进去导致的问题,但是头文件包已经写入了
回复

使用道具 举报

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

本版积分规则



关闭

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

正点原子公众号

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

GMT+8, 2025-6-9 16:48

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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