OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 4495|回复: 9

stm32 SYSTEM文件夹编译错误

[复制链接]

1

主题

6

帖子

0

精华

新手入门

积分
10
金钱
10
注册时间
2018-8-9
在线时间
1 小时
发表于 2018-8-9 15:29:35 | 显示全部楼层 |阅读模式
1金钱
照着原子的视频自己写了跑马灯的寄存器程序,把SYSTEM文件夹搬过来后,编译不成功。
compiling delay.c...
..\SYSTEM\sys\stm32f4xx.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)"
..\SYSTEM\delay\delay.c: 0 warnings, 1 error
compiling usart.c...
..\SYSTEM\sys\stm32f4xx.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)"
..\SYSTEM\usart\usart.c: 0 warnings, 1 error
compiling sys.c...
..\SYSTEM\sys\stm32f4xx.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)"
..\SYSTEM\sys\sys.c: 0 warnings, 1 error
compiling main.c...
..\SYSTEM\sys\stm32f4xx.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)"
..\USER\main.c: 0 warnings, 1 error
compiling LED.C...
..\SYSTEM\sys\stm32f4xx.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)"
..\HARDWARE\LED\LED.C: 0 warnings, 1 error
"..\OBJ\LED_light.axf" - 5 Error(s), 0 Warning(s).
Target not created.

最佳答案

查看完整内容[请看2#楼]

1.把c/c++里的宏定义改为:STM32F40_41xxx,USE_STDPERIPH_DRIVER 2.注释掉stm32f4xx.h里的9136行 3.usart.c文件38行加void
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

39

主题

535

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1065
金钱
1065
注册时间
2018-3-27
在线时间
378 小时
发表于 2018-8-9 15:29:36 | 显示全部楼层
1.把c/c++里的宏定义改为:STM32F40_41xxx,USE_STDPERIPH_DRIVER
2.注释掉stm32f4xx.h里的9136行
3.usart.c文件38行加void
回复

使用道具 举报

1

主题

6

帖子

0

精华

新手入门

积分
10
金钱
10
注册时间
2018-8-9
在线时间
1 小时
 楼主| 发表于 2018-8-9 15:30:11 | 显示全部楼层
小白心慌慌
回复

使用道具 举报

39

主题

535

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1065
金钱
1065
注册时间
2018-3-27
在线时间
378 小时
发表于 2018-8-9 15:33:44 | 显示全部楼层
芯片选了吗
回复

使用道具 举报

39

主题

535

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1065
金钱
1065
注册时间
2018-3-27
在线时间
378 小时
发表于 2018-8-9 15:37:38 | 显示全部楼层
编译错误,百度一下一般都找得到
回复

使用道具 举报

1

主题

6

帖子

0

精华

新手入门

积分
10
金钱
10
注册时间
2018-8-9
在线时间
1 小时
 楼主| 发表于 2018-8-9 15:39:52 | 显示全部楼层

在SYSTEM加入前编译能通过,说明芯片没问题
回复

使用道具 举报

1

主题

6

帖子

0

精华

新手入门

积分
10
金钱
10
注册时间
2018-8-9
在线时间
1 小时
 楼主| 发表于 2018-8-9 15:40:51 | 显示全部楼层
qiuzhicheng 发表于 2018-8-9 15:37
编译错误,百度一下一般都找得到

百度方法基本都是C/C++的宏定义错误,我之前一直是这么定义的没错误
回复

使用道具 举报

39

主题

535

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1065
金钱
1065
注册时间
2018-3-27
在线时间
378 小时
发表于 2018-8-9 15:48:37 | 显示全部楼层
集成依稀 发表于 2018-8-9 15:40
百度方法基本都是C/C++的宏定义错误,我之前一直是这么定义的没错误

你发你工程看一下
回复

使用道具 举报

1

主题

6

帖子

0

精华

新手入门

积分
10
金钱
10
注册时间
2018-8-9
在线时间
1 小时
 楼主| 发表于 2018-8-9 15:53:16 | 显示全部楼层
qiuzhicheng 发表于 2018-8-9 15:48
你发你工程看一下

压缩包发了

寄存器.rar

302.87 KB, 下载次数: 28

回复

使用道具 举报

1

主题

6

帖子

0

精华

新手入门

积分
10
金钱
10
注册时间
2018-8-9
在线时间
1 小时
 楼主| 发表于 2018-8-9 16:07:24 | 显示全部楼层
qiuzhicheng 发表于 2018-8-9 16:02
1.把c/c++里的宏定义改为:STM32F40_41xxx,USE_STDPERIPH_DRIVER
2.注释掉stm32f4xx.h里的9136行
3.usart ...

感谢!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-7-12 18:44

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表