stm32 SYSTEM文件夹编译错误

2019-07-20 06:46发布

照着原子的视频自己写了跑马灯的寄存器程序,把SYSTEM文件夹搬过来后,编译不成功。
compiling delay.c...
..SYSTEMsysstm32f4xx.h(102): error:  #35: #error directive: "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
   #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
..SYSTEMdelaydelay.c: 0 warnings, 1 error
compiling usart.c...
..SYSTEMsysstm32f4xx.h(102): error:  #35: #error directive: "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
   #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
..SYSTEMusartusart.c: 0 warnings, 1 error
compiling sys.c...
..SYSTEMsysstm32f4xx.h(102): error:  #35: #error directive: "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
   #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
..SYSTEMsyssys.c: 0 warnings, 1 error
compiling main.c...
..SYSTEMsysstm32f4xx.h(102): error:  #35: #error directive: "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
   #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
..USERmain.c: 0 warnings, 1 error
compiling LED.C...
..SYSTEMsysstm32f4xx.h(102): error:  #35: #error directive: "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
   #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
..HARDWARELEDLED.C: 0 warnings, 1 error
"..OBJLED_light.axf" - 5 Error(s), 0 Warning(s).
Target not created.

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
9条回答
qiuzhicheng
1楼-- · 2019-07-20 09:47
1.把c/c++里的宏定义改为:STM32F40_41xxx,USE_STDPERIPH_DRIVER
2.注释掉stm32f4xx.h里的9136行
3.usart.c文件38行加void
集成依稀
2楼-- · 2019-07-20 11:09
小白心慌慌
qiuzhicheng
3楼-- · 2019-07-20 15:34
 精彩回答 2  元偷偷看……
qiuzhicheng
4楼-- · 2019-07-20 20:10
编译错误,百度一下一般都找得到
集成依稀
5楼-- · 2019-07-21 01:00
 精彩回答 2  元偷偷看……
集成依稀
6楼-- · 2019-07-21 05:12
 精彩回答 2  元偷偷看……

一周热门 更多>