解决STM32工程出现:Undefined symbol TIM_ClearFlag (referred from hcsr04.o).错误。类型问题Undefined symbol TIM_xxx ...

博客指出工程出错是因FWLIB目录下未添加stm32f10x_tim.c文件,添加即可。还介绍了利用库开发时,如使用led.c的调用步骤,包括拷贝文件、加载文件、包含头文件、添加标准库文件、去掉注释以及添加文件路径等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

出错原因:

工程FWLIB目录下没有添加stm32f10x_tim.c文件。

添加即可。

 

一般利用库开发,将ppp.c(ppp.c又调用了库stm32f10x_xx.h)写好之后的调用步骤:

举例使用led.c:

1,将led.c和led.h拷贝到工程下的USE目录下,并在工程目录中加载led.c文件。

2,在main.c的头文件包含区中包含led.h,并在main.c中调用相关子函数。

3,因为led.c又包含了标准库文件所以还要两步

  1>,在工程FWLIB目录中添加stm32f10x_gpio.h文件

  2>,在stm32f10x_config.h中将相关注释去掉

4,在C/C++选项下Include Paths中添加文件路径。

转载于:https://www.cnblogs.com/ming-4/p/10563438.html

什么问题Rebuild started: Project: Template *** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Rebuild target 'Target 1' compiling core_cm3.c... assembling startup_stm32f10x_hd.s... compiling beep.c... compiling system.c... compiling led.c... compiling misc.c... compiling key.c... compiling SysTick.c... compiling stm32f10x_it.c... compiling main.c... compiling system_stm32f10x.c... compiling stm32f10x_gpio.c... compiling stm32f10x_exti.c... compiling usart.c... compiling exti.c... compiling stm32f10x_rcc.c... linking... .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_ClearFlag (referred from usart.o). .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_Cmd (referred from usart.o). .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_GetFlagStatus (referred from usart.o). .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_GetITStatus (referred from usart.o). .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_ITConfig (referred from usart.o). .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_Init (referred from usart.o). .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_ReceiveData (referred from usart.o). .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_SendData (referred from usart.o). Not enough information to list image symbols. Not enough information to list load addresses in the image map. Finished: 2 information, 0 warning and 8 error messages. ".\Obj\Template.axf" - 8 Error(s), 0 Warning(s). Target not created. Build Time Elapsed: 00:00:01
03-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值