×
嵌入式 > 嵌入式开发 > 详情

stm32编译出问题解决

发布时间:2020-08-28 发布时间:
|
.FWlibincstm32f10x_conf.h(33): warning:#14-D: extra text after expected end of preprocessing directive额外的文本在在预处理命令后面出现

#include "stm32f10x_dma.h" */出问题的地方就是这个 “*/

仿照原子自己建立工程的时候出现的问题修改:

问题及修改:

1)..SYSTEMdelaydelay.c(27): error:#20: identifier "SysTick_CLKSource_HCLK_Div8" is undefined

解决方法:在delay.c中添加“#include"misc.h"”

2)..SYSTEMsyssys.c(18): error:#20: identifier "NVIC_PriorityGroup_2" is undefined

解决方法:在sys.c中添加“#include"misc.h"”

3). ..SYSTEMusartusart.c(75): error:#20: identifier "GPIO_InitTypeDef" is undefined

解决方法:在usart.c中添加“#include”stm32f10x_gpio.h””

4)..SYSTEMusartusart.c(77): error:#20: identifier "USART_InitTypeDef" is undefined

解决方法:在usart.c中添加“#include"stm32f10x_usart.h"”

5)..SYSTEMusartusart.c(80): error:#20: identifier "NVIC_InitTypeDef" is undefined

解决方法:在usart.c中添加“#include"misc.h"”

6)..SYSTEMusartusart.c(82): warning:#223-D: function "RCC_APB2PeriphClockCmd" declared implicitly

解决方法:在usart.c中添加“#include"stm32f10x_rcc.h"”

7)..HARDWARELEDled.c(22): error:#20: identifier "GPIO_InitTypeDef" is undefined

解决方法:在led.c中添加“#include"stm32f10x_gpio.h"”

8)..HARDWARELEDled.c(25): error:#20: identifier "RCC_APB2Periph_GPIOA" is undefined

解决方法:在led.c中添加“#include"stm32f10x_rcc.h"”

20150318

..SysTick_LED.axf: Error: L6218E: Undefined symbol uart_init (referred from main.o).

这个错误说的是在main函数中引用了uart_init()函数,但是这个函数没有被定义。

其实这个函数是在uart.c中定义的并且在uart.h中做了声明,uart.h也被包含进了main函数了。

出问题的原因是这样的:uart.c中uart_init()函数是定义在预编译命令对

#if EN_USART1_RX

...............

#endif

中的。而#define EN_USART1_RX 0所以,这对预编译命令不被编译,即uart_init()没有被定义。将

#define EN_USART1_RX 0改成#define EN_USART1_RX1就好了。

20150321

编译没有错误,但是串口无法向串口中断打印信息,原因是串口输出要用到相应的GPIO,程序中忘了使能这些IO的时钟,使能一下就好了。



『本文转载自网络,版权归原作者所有,如有侵权请联系删除』

热门文章 更多
Recogni:将高端AI芯片推向自动驾驶边缘