★ 您好,欢迎大驾光临!!服务热线:0512-57750678  18021615678
Logo
网站首页 关于我们 产品中心 企业文化
新闻资讯 优势产品 在线留言 联系我们
您现在的位置:网站首页 >> 新闻资讯 >> 初学STM32遇到的一些问题

初学STM32遇到的一些问题

1.设置工程时,如果忘记了在C/C++选项卡上设置STM32F10X_HD,USE_STDPEFIPH_DRIVER编译时会报如下的错误

Build target 'USART'  

compiling stm32f10x_it.c...  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h:     ^  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h: ..\User\stm32f10x_it.c: 0 warnings, 1 error  

compiling main.c...  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h:     ^  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h: ..\User\main.c: 0 warnings, 1 error  

compiling core_cm3.c...  

compiling system_stm32f10x.c...  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h:     ^  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h: ..\User\system_stm32f10x.c: 0 warnings, 1 error  

compiling stm32f10x_usart.c...  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h:     ^  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h: ..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c: 0 warnings, 1 error  

compiling stm32f10x_gpio.c...  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h:     ^  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h: ..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c: 0 warnings, 1 error  

compiling stm32f10x_rcc.c...  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h:     ^  

..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h: ..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c: 0 warnings, 1 error  

Target not created  


2.要注意新建工程包含库文件的路径是

\Libraries\STM32F10x_StdPeriph_Driver\inc

而不是

\Libraries\STM32F10x_StdPeriph_Driver\src
 

3.Overlapping of Algorithms at Address 08000000H错误

工程设置里,误多添加了下载算法,删除后即可。



//============================================================================================

备注::

1>今天烧写STM32遇到一个新问题----出现data not matching at address 0x80000000,最后把问题找到是烧写的串口线出了问题 ,导致烧完程序再读回验证出了问题。




上一篇:[STM8] 通过STM8芯片唯一ID加密程序
下一篇:STM32出现HardFault_Handler问题查找方法
返回顶部

江苏豹发力电子科技有限公司 版权所有 未经授权禁止复制或镜像
CopyRight 2022   www.baofali.net  All rights reserved

电话:0512-57750678   E-mai:1989186555@qq.com  苏ICP备2022026117号-1