STM32F10X _FAULT

本文针对STM32F10x系列微控制器在编译过程中出现的常见错误进行了解析,包括配置不当导致的错误、宏定义冲突、未定义标识符等问题,并提供了具体的解决步骤。

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

一. ERROR # 35:"Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"  :  修改 配置框-->C/C++ -->Preprocessor                     Symbols-->Define-->USE_STDPERIPH_DRIVER,STM32F10X_HD      HD与芯片启动类型有关   注意芯片类型与启动文件的匹配.

二 . Error:  #101: "ERROR" has already been declared in the current scope
    Error:  #101: "SUCCESS" has already been declared in the current scope
    Error:  #256:e invalid redeclaration of type name "ErrorStatus" (declared at line 524 of "..\CMSIS\stm32f10x.h") 在stm32f10x_conf_h文件,将“#include               "stm32f10x_type.h"”注释掉,再保存编译。 

      如果依然还有错误,修改 配置框-->C/C++ -->include paths  添加.c /.h/.s文件位置。

三. Error: #20:  identifier "****" is undefined   ,未定义。

四. Error: #268:  declaration may not appear after executablestatement ,声明变量应该放在引用函数之前。

五. Warning #47-D: incompatible redefinition of macro "**"  定义重复,并且被定义为另一个值。

. error: L6235E: More than one section matches selector - cannot all be FIRST/LAST错误,网络上教程也很多,我这里把图截上来,也简明。


1.查看工程里的几个编程文件


你会发现startup_stm32f10x_cl.s前面的图标和不太一样。原因,网络上说得很多。

2.右击startup_stm32f10x_cls.s这个文件,选择option.....


右边的两个选项include in Target Build和Always Build灰勾去掉。


然后确定,其它几个文件也如这样操作。但是注意保留startup_stm32f10x_xl.s这个文件。

3.更改后的工程文件如下所示:


4.重新clean一下工程,然后rebuild 一下。


通过。。。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

怀想天空2011

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值