OpenEdv-开源电子网

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

mdk建工程不成功

[复制链接]

15

主题

181

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
389
金钱
389
注册时间
2014-11-8
在线时间
40 小时
发表于 2015-3-17 22:48:38 | 显示全部楼层 |阅读模式
5金钱
我新建了一个模板,打算移植下原子哥的文件系统,可是发现总是编译不过去,之前移植rtc的时候也遇到了类似的问题。
出现如下错误:
Build target 'Target 1'
compiling MMC_SD.C...
..\HARDWARE\SD\MMC_SD.C(30): error:  #20: identifier "SPI_BaudRatePrescaler_256" is undefined
..\HARDWARE\SD\MMC_SD.C(35): error:  #20: identifier "SPI_BaudRatePrescaler_2" is undefined
compiling spi.c...
..\HARDWARE\SPI\spi.c(24): error:  #20: identifier "SPI_InitTypeDef" is undefined
..\HARDWARE\SPI\spi.c(36): error:  #20: identifier "SPI_Direction_2Lines_FullDuplex" is undefined
..\HARDWARE\SPI\spi.c(37): error:  #20: identifier "SPI_Mode_Master" is undefined
..\HARDWARE\SPI\spi.c(38): error:  #20: identifier "SPI_DataSize_8b" is undefined
..\HARDWARE\SPI\spi.c(39): error:  #20: identifier "SPI_CPOL_High" is undefined
..\HARDWARE\SPI\spi.c(40): error:  #20: identifier "SPI_CPHA_2Edge" is undefined
..\HARDWARE\SPI\spi.c(41): error:  #20: identifier "SPI_NSS_Soft" is undefined
..\HARDWARE\SPI\spi.c(42): error:  #20: identifier "SPI_BaudRatePrescaler_256" is undefined
..\HARDWARE\SPI\spi.c(43): error:  #20: identifier "SPI_FirstBit_MSB" is undefined
..\HARDWARE\SPI\spi.c(45): warning:  #223-D: function "SPI_Init" declared implicitly
..\HARDWARE\SPI\spi.c(47): warning:  #223-D: function "SPI_Cmd" declared implicitly
..\HARDWARE\SPI\spi.c(65): warning:  #223-D: function "SPI_Cmd" declared implicitly
..\HARDWARE\SPI\spi.c(75): warning:  #223-D: function "SPI_I2S_GetFlagStatus" declared implicitly
..\HARDWARE\SPI\spi.c(75): error:  #20: identifier "SPI_I2S_FLAG_TXE" is undefined
..\HARDWARE\SPI\spi.c(80): warning:  #223-D: function "SPI_I2S_SendData" declared implicitly
..\HARDWARE\SPI\spi.c(83): error:  #20: identifier "SPI_I2S_FLAG_RXNE" is undefined
..\HARDWARE\SPI\spi.c(88): warning:  #223-D: function "SPI_I2S_ReceiveData" declared implicitly
Target not created



而当我打开点击错误进入MMC_SD.c是却发现已经包含了#include "spi.h"。不明白怎么回事,特请各位大侠解释
(我用的是库函数版本,FWLib也包含了#include "stm32f10x_spi.h"    附件为错误截图)
QQ截图20150317224504.png

最佳答案

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

应该是在stm32f10x_conf.h的头文件中没有把spi的注释给去掉,去掉就行了!!!
Good good study , day day up...
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

14

主题

1592

帖子

0

精华

资深版主

Rank: 8Rank: 8

积分
2622
金钱
2622
注册时间
2014-7-17
在线时间
350 小时
发表于 2015-3-17 22:48:39 | 显示全部楼层
应该是在stm32f10x_conf.h的头文件中没有把spi的注释给去掉,去掉就行了!!!
回复

使用道具 举报

15

主题

181

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
389
金钱
389
注册时间
2014-11-8
在线时间
40 小时
 楼主| 发表于 2015-3-18 11:04:23 | 显示全部楼层
回复【2楼】FantaSy_:
---------------------------------
 1楼智慧,完美解决。
Good good study , day day up...
回复

使用道具 举报

15

主题

181

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
389
金钱
389
注册时间
2014-11-8
在线时间
40 小时
 楼主| 发表于 2015-3-18 11:07:46 | 显示全部楼层
对了,在问一下stm32f10x_conf.h这个文件是st公司的库对吗?
Good good study , day day up...
回复

使用道具 举报

14

主题

1592

帖子

0

精华

资深版主

Rank: 8Rank: 8

积分
2622
金钱
2622
注册时间
2014-7-17
在线时间
350 小时
发表于 2015-3-18 11:24:40 | 显示全部楼层
回复【4楼】Just Beat It:
---------------------------------
是啊!!!!
回复

使用道具 举报

15

主题

181

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
389
金钱
389
注册时间
2014-11-8
在线时间
40 小时
 楼主| 发表于 2015-3-18 11:29:25 | 显示全部楼层
奥奥,那明白了,谢谢你啦,结贴!
Good good study , day day up...
回复

使用道具 举报

0

主题

1

帖子

0

精华

新手入门

积分
19
金钱
19
注册时间
2021-3-2
在线时间
3 小时
发表于 2021-5-21 16:12:35 | 显示全部楼层
FantaSy_ 发表于 2015-3-17 22:48
应该是在stm32f10x_conf.h的头文件中没有把spi的注释给去掉,去掉就行了!!!

厉害厉害,长知识了
回复

使用道具 举报

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

本版积分规则



关闭

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

正点原子公众号

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

GMT+8, 2025-6-27 11:48

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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