OpenEdv-开源电子网

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

F407,按照书上写的步骤一点点创建出来的工程,报错.

[复制链接]

8

主题

42

帖子

0

精华

初级会员

Rank: 2

积分
156
金钱
156
注册时间
2017-9-7
在线时间
15 小时
发表于 2018-8-13 16:57:09 | 显示全部楼层 |阅读模式
10金钱
本帖最后由 Asien 于 2018-8-13 17:08 编辑

*** Using Compiler 'V5.06 update 4 (build 422)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'Asiens'
assembling startup_stm32f40_41xxx.s...
compiling main.c...
USER\main.c(1): error:  #77-D: this declaration has no storage class or type specifier
  手册中讲解到步骤15的时候的main.c源码如下:
USER\main.c(1): error:  #65: expected a ";"
  手册中讲解到步骤15的时候的main.c源码如下:
USER\main.c(1): error:  #7: unrecognized token
  手册中讲解到步骤15的时候的main.c源码如下:
USER\stm32f4xx.h(464): warning:  #12-D: parsing restarts here after previous syntax error
  } IRQn_Type;
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
USER\main.c: 1 warning, 4 errors
compiling stm32f4xx_it.c...
compiling system_stm32f4xx.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
USER\system_stm32f4xx.c: 0 warnings, 1 error
compiling stm32f4xx_adc.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_adc.c: 0 warnings, 1 error
compiling misc.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\misc.c: 0 warnings, 1 error
compiling stm32f4xx_crc.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_crc.c: 0 warnings, 1 error
compiling stm32f4xx_can.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_can.c: 0 warnings, 1 error
compiling stm32f4xx_cryp_aes.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_cryp_aes.c: 0 warnings, 1 error
compiling stm32f4xx_cryp.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_cryp.c: 0 warnings, 1 error
compiling stm32f4xx_cryp_des.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_cryp_des.c: 0 warnings, 1 error
compiling stm32f4xx_cryp_tdes.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_cryp_tdes.c: 0 warnings, 1 error
compiling stm32f4xx_dbgmcu.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_dbgmcu.c: 0 warnings, 1 error
compiling stm32f4xx_dac.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_dac.c: 0 warnings, 1 error
compiling stm32f4xx_dcmi.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_dcmi.c: 0 warnings, 1 error
compiling stm32f4xx_dma.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_dma.c: 0 warnings, 1 error
compiling stm32f4xx_exti.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_exti.c: 0 warnings, 1 error
compiling stm32f4xx_dma2d.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_dma2d.c: 0 warnings, 1 error
compiling stm32f4xx_flash.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_flash.c: 0 warnings, 1 error
compiling stm32f4xx_flash_ramfunc.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_flash_ramfunc.c: 0 warnings, 1 error
compiling stm32f4xx_gpio.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_gpio.c: 0 warnings, 1 error
compiling stm32f4xx_hash.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_hash.c: 0 warnings, 1 error
compiling stm32f4xx_hash_md5.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_hash_md5.c: 0 warnings, 1 error
compiling stm32f4xx_hash_sha1.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_hash_sha1.c: 0 warnings, 1 error
compiling stm32f4xx_i2c.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_i2c.c: 0 warnings, 1 error
compiling stm32f4xx_iwdg.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_iwdg.c: 0 warnings, 1 error
compiling stm32f4xx_ltdc.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_ltdc.c: 0 warnings, 1 error
compiling stm32f4xx_pwr.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_pwr.c: 0 warnings, 1 error
compiling stm32f4xx_rcc.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_rcc.c: 0 warnings, 1 error
compiling stm32f4xx_rtc.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_rtc.c: 0 warnings, 1 error
compiling stm32f4xx_rng.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_rng.c: 0 warnings, 1 error
compiling stm32f4xx_sdio.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_sdio.c: 0 warnings, 1 error
compiling stm32f4xx_sai.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_sai.c: 0 warnings, 1 error
compiling stm32f4xx_syscfg.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_syscfg.c: 0 warnings, 1 error
compiling stm32f4xx_spi.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_spi.c: 0 warnings, 1 error
compiling stm32f4xx_tim.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_tim.c: 0 warnings, 1 error
compiling stm32f4xx_usart.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_usart.c: 0 warnings, 1 error
compiling stm32f4xx_fsmc.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_fsmc.c: 0 warnings, 1 error
compiling stm32f4xx_wwdg.c...
.\CORE\core_cm4.h(169): error:  #5: cannot open source input file "core_cmInstr.h": No such file or directory
  #include <core_cmInstr.h>                /* Core Instruction Access                         */
FWLIB\src\stm32f4xx_wwdg.c: 0 warnings, 1 error
assembling stm32f4xx_fsmc.s...
.\objects\stm32f4xx_fsmc.s(1): warning: A1313W: Missing END directive at end of file
".\Objects\Asiens.axf" - 40 Error(s), 2 Warning(s).
Target not created.
Build Time Elapsed:  00:00:09

Asiens.zip

7.59 MB, 下载次数: 60

工程完整文件

最佳答案

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

解决了,我用的纸质书创建的工程,不太对,最后用A盘的电子版创建出来的就没问题.
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

8

主题

42

帖子

0

精华

初级会员

Rank: 2

积分
156
金钱
156
注册时间
2017-9-7
在线时间
15 小时
 楼主| 发表于 2018-8-13 16:57:10 | 显示全部楼层
正点原子 发表于 2018-8-14 02:09
从第一个错误开始找

解决了,我用的纸质书创建的工程,不太对,最后用A盘的电子版创建出来的就没问题.
回复

使用道具 举报

1

主题

18

帖子

0

精华

初级会员

Rank: 2

积分
178
金钱
178
注册时间
2018-8-4
在线时间
15 小时
发表于 2018-8-13 17:03:05 | 显示全部楼层
您是用的最新的mdk5.14吧。 如果是,从固件库包里面的include下面复制这个文件(或者直接到固件库包下面去搜索这个文件),到工程的任何一个包含到路径的目录,,比如库函数的话,CORE目录下面。。寄存器的话,SYSTEM/sys目录
回复

使用道具 举报

109

主题

5564

帖子

0

精华

资深版主

Rank: 8Rank: 8

积分
10570
金钱
10570
注册时间
2017-2-18
在线时间
1913 小时
发表于 2018-8-13 17:03:33 | 显示全部楼层
将工程放上来看看
回复

使用道具 举报

8

主题

42

帖子

0

精华

初级会员

Rank: 2

积分
156
金钱
156
注册时间
2017-9-7
在线时间
15 小时
 楼主| 发表于 2018-8-13 17:04:00 | 显示全部楼层
按照提示我把两个头文件放到CORE里面,还是报错,.FWLIB\src\stm32f4xx_fsmc.c(425): error:  #20: identifier "FSMC_Bank3" is undefined       FSMC_Bank3->PCR3 = tmppcr; FWLIB\src\stm32f4xx_fsmc.c(477): error:  #20: identifier "FSMC_Bank2" is undefined         FSMC_Bank2->PCR2 |= PCR_PBKEN_SET; FWLIB\src\stm32f4xx_fsmc.c(481): error:  #20: identifier "FSMC_Bank3" is undefined         FSMC_Bank3->PCR3 |= PCR_PBKEN_SET; FWLIB\src\stm32f4xx_fsmc.c(489): error:  #20: identifier "FSMC_Bank2" is undefined         FSMC_Bank2->PCR2 &= PCR_PBKEN_RESET; FWLIB\src\stm32f4xx_fsmc.c(493): error:  #20: identifier "FSMC_Bank3" is undefined         FSMC_Bank3->PCR3 &= PCR_PBKEN_RESET; FWLIB\src\stm32f4xx_fsmc.c(517): error:  #20: identifier "FSMC_Bank2" is undefined         FSMC_Bank2->PCR2 |= PCR_ECCEN_SET; FWLIB\src\stm32f4xx_fsmc.c(521): error:  #20: identifier "FSMC_Bank3" is undefined         FSMC_Bank3->PCR3 |= PCR_ECCEN_SET; FWLIB\src\stm32f4xx_fsmc.c(529): error:  #20: identifier "FSMC_Bank2" is undefined         FSMC_Bank2->PCR2 &= PCR_ECCEN_RESET; FWLIB\src\stm32f4xx_fsmc.c(533): error:  #20: identifier "FSMC_Bank3" is undefined         FSMC_Bank3->PCR3 &= PCR_ECCEN_RESET; FWLIB\src\stm32f4xx_fsmc.c(553): error:  #20: identifier "FSMC_Bank2" is undefined       eccval = FSMC_Bank2->ECCR2; FWLIB\src\stm32f4xx_fsmc.c(558): error:  #20: identifier "FSMC_Bank3" is undefined       eccval = FSMC_Bank3->ECCR3; FWLIB\src\stm32f4xx_fsmc.c(613): error:  #20: identifier "FSMC_Bank4" is undefined
回复

使用道具 举报

8

主题

42

帖子

0

精华

初级会员

Rank: 2

积分
156
金钱
156
注册时间
2017-9-7
在线时间
15 小时
 楼主| 发表于 2018-8-13 17:09:38 | 显示全部楼层
peng1554 发表于 2018-8-13 17:03
将工程放上来看看

放了,看看,实在不行,我就自己建立工程了,他这个试了几遍都是不行,不知道什么原因
回复

使用道具 举报

8

主题

42

帖子

0

精华

初级会员

Rank: 2

积分
156
金钱
156
注册时间
2017-9-7
在线时间
15 小时
 楼主| 发表于 2018-8-13 17:09:47 | 显示全部楼层
peng1554 发表于 2018-8-13 17:03
将工程放上来看看

放了,看看,实在不行,我就自己建立工程了,他这个试了几遍都是不行,不知道什么原因
回复

使用道具 举报

8

主题

42

帖子

0

精华

初级会员

Rank: 2

积分
156
金钱
156
注册时间
2017-9-7
在线时间
15 小时
 楼主| 发表于 2018-8-13 17:11:08 | 显示全部楼层
Chosen1 发表于 2018-8-13 17:03
您是用的最新的mdk5.14吧。 如果是,从固件库包里面的include下面复制这个文件(或者直接到固件库包下面去 ...

5.22版本的,包含了头文件都包含了.
回复

使用道具 举报

8

主题

42

帖子

0

精华

初级会员

Rank: 2

积分
156
金钱
156
注册时间
2017-9-7
在线时间
15 小时
 楼主| 发表于 2018-8-13 17:24:53 | 显示全部楼层
Chosen1 发表于 2018-8-13 17:03
您是用的最新的mdk5.14吧。 如果是,从固件库包里面的include下面复制这个文件(或者直接到固件库包下面去 ...

库函数版本
回复

使用道具 举报

109

主题

5564

帖子

0

精华

资深版主

Rank: 8Rank: 8

积分
10570
金钱
10570
注册时间
2017-2-18
在线时间
1913 小时
发表于 2018-8-13 17:40:05 | 显示全部楼层
Asien 发表于 2018-8-13 17:09
放了,看看,实在不行,我就自己建立工程了,他这个试了几遍都是不行,不知道什么原因

我这将407例程中CORE文件夹中的5个文件直接替换到你工程对应文件夹下。然后编译显示0 Error

Asiens.rar

7 MB, 下载次数: 47

回复

使用道具 举报

8

主题

42

帖子

0

精华

初级会员

Rank: 2

积分
156
金钱
156
注册时间
2017-9-7
在线时间
15 小时
 楼主| 发表于 2018-8-13 19:47:48 | 显示全部楼层
peng1554 发表于 2018-8-13 17:40
我这将407例程中CORE文件夹中的5个文件直接替换到你工程对应文件夹下。然后编译显示0 Error

我试试看
回复

使用道具 举报

8

主题

42

帖子

0

精华

初级会员

Rank: 2

积分
156
金钱
156
注册时间
2017-9-7
在线时间
15 小时
 楼主| 发表于 2018-8-13 20:12:28 | 显示全部楼层
peng1554 发表于 2018-8-13 17:40
我这将407例程中CORE文件夹中的5个文件直接替换到你工程对应文件夹下。然后编译显示0 Error

还一个问题,我替换之后还是会报错,因为FSMC这个.c文件里面报错,我只有把这个函数删除才没有错误,但是视频说这个不能删除/
回复

使用道具 举报

109

主题

5564

帖子

0

精华

资深版主

Rank: 8Rank: 8

积分
10570
金钱
10570
注册时间
2017-2-18
在线时间
1913 小时
发表于 2018-8-13 20:23:10 | 显示全部楼层
你下载我发上来的程序看看!
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165524
金钱
165524
注册时间
2010-12-1
在线时间
2116 小时
发表于 2018-8-14 02:09:19 | 显示全部楼层
从第一个错误开始找
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复

使用道具 举报

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

本版积分规则



关闭

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

正点原子公众号

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

GMT+8, 2025-6-2 20:23

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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