关于keil编译的问题

2019-07-20 05:34发布

我按照原子的教程,自己新建了一个F4的工程文件,但编译的时候出现两个stm32f4xx.h,导致编译不通过,很多定义重复了

123.png
但我USER文件下只有一个stm32f4xx.h,我也试过原子自带教程的工程文件,编译没有问题,能够通过。

肯定是我哪里没设置对出现的问题,我试着打开过这两个头文件,应该是同一个.h,请教一下谁遇到过这个问题
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
8条回答
巫妖
2019-07-20 16:56
本帖最后由 巫妖 于 2018-9-5 17:01 编辑
qiuzhicheng 发表于 2018-9-5 16:56
错误提示是什么
我查过这些错误,都是在stm32f4xx.h头文件里定义命名的
..FWLIBsrcstm32f4xx_fmc.c(144): error:  #20: identifier "FMC_Bank1" is undefined
      FMC_Bank1->BTCR[FMC_Bank] = 0x000030DB;   
..FWLIBsrcstm32f4xx_fmc.c(149): error:  #20: identifier "FMC_Bank1" is undefined
      FMC_Bank1->BTCR[FMC_Bank] = 0x000030D2;
..FWLIBsrcstm32f4xx_fmc.c(151): error:  #20: identifier "FMC_Bank1" is undefined
    FMC_Bank1->BTCR[FMC_Bank + 1] = 0x0FFFFFFF;
..FWLIBsrcstm32f4xx_fmc.c(152): error:  #20: identifier "FMC_Bank1E" is undefined
    FMC_Bank1E->BWTR[FMC_Bank] = 0x0FFFFFFF;  
..FWLIBsrcstm32f4xx_fmc.c(191): error:  #20: identifier "FMC_Bank1" is undefined
    FMC_Bank1->BTCR[FMC_NORSRAMInitStruct->FMC_Bank] =   
..FWLIBsrcstm32f4xx_fmc.c(242): error:  #20: identifier "FMC_Bank1E" is undefined
      FMC_Bank1E->BWTR[FMC_NORSRAMInitStruct->FMC_Bank] =   
..FWLIBsrcstm32f4xx_fmc.c(252): error:  #20: identifier "FMC_Bank1E" is undefined
      FMC_Bank1E->BWTR[FMC_NORSRAMInitStruct->FMC_Bank] = 0x0FFFFFFF;
..FWLIBsrcstm32f4xx_fmc.c(304): error:  #20: identifier "FMC_Bank1" is undefined
      FMC_Bank1->BTCR[FMC_Bank] |= BCR_MBKEN_SET;
..FWLIBsrcstm32f4xx_fmc.c(309): error:  #20: identifier "FMC_Bank1" is undefined
      FMC_Bank1->BTCR[FMC_Bank] &= BCR_MBKEN_RESET;
..FWLIBsrcstm32f4xx_fmc.c(377): error:  #20: identifier "FMC_Bank2" is undefined
      FMC_Bank2->PCR2 = 0x00000018;
..FWLIBsrcstm32f4xx_fmc.c(386): error:  #20: identifier "FMC_Bank3" is undefined
      FMC_Bank3->PCR3 = 0x00000018;
..FWLIBsrcstm32f4xx_fmc.c(445): error:  #20: identifier "FMC_Bank2" is undefined
      FMC_Bank2->PCR2 = tmppcr;
..FWLIBsrcstm32f4xx_fmc.c(452): error:  #20: identifier "FMC_Bank3" is undefined
      FMC_Bank3->PCR3 = tmppcr;
..FWLIBsrcstm32f4xx_fmc.c(504): error:  #20: identifier "FMC_Bank2" is undefined
        FMC_Bank2->PCR2 |= PCR_PBKEN_SET;
..FWLIBsrcstm32f4xx_fmc.c(508): error:  #20: identifier "FMC_Bank3" is undefined
        FMC_Bank3->PCR3 |= PCR_PBKEN_SET;
..FWLIBsrcstm32f4xx_fmc.c(516): error:  #20: identifier "FMC_Bank2" is undefined
        FMC_Bank2->PCR2 &= PCR_PBKEN_RESET;
..FWLIBsrcstm32f4xx_fmc.c(520): error:  #20: identifier "FMC_Bank3" is undefined
        FMC_Bank3->PCR3 &= PCR_PBKEN_RESET;
..FWLIBsrcstm32f4xx_fmc.c(544): error:  #20: identifier "FMC_Bank2" is undefined
        FMC_Bank2->PCR2 |= PCR_ECCEN_SET;
..FWLIBsrcstm32f4xx_fmc.c(548): error:  #20: identifier "FMC_Bank3" is undefined
        FMC_Bank3->PCR3 |= PCR_ECCEN_SET;
..FWLIBsrcstm32f4xx_fmc.c(556): error:  #20: identifier "FMC_Bank2" is undefined
        FMC_Bank2->PCR2 &= PCR_ECCEN_RESET;
..FWLIBsrcstm32f4xx_fmc.c(560): error:  #20: identifier "FMC_Bank3" is undefined
        FMC_Bank3->PCR3 &= PCR_ECCEN_RESET;
..FWLIBsrcstm32f4xx_fmc.c(580): error:  #20: identifier "FMC_Bank2" is undefined
      eccval = FMC_Bank2->ECCR2;
..FWLIBsrcstm32f4xx_fmc.c(585): error:  #20: identifier "FMC_Bank3" is undefined
      eccval = FMC_Bank3->ECCR3;
..FWLIBsrcstm32f4xx_fmc.c(640): error:  #20: identifier "FMC_Bank4" is undefined
    FMC_Bank4->PCR4 = 0x00000018;
..FWLIBsrcstm32f4xx_fmc.c(676): error:  #20: identifier "FMC_Bank4" is undefined
    FMC_Bank4->PCR4 = (uint32_t)FMC_PCCARDInitStruct->FMC_Waitfeature |
..FWLIBsrcstm32f4xx_fmc.c(739): error:  #20: identifier "FMC_Bank4" is undefined
      FMC_Bank4->PCR4 |= PCR_PBKEN_SET;
..FWLIBsrcstm32f4xx_fmc.c(744): error:  #20: identifier "FMC_Bank4" is undefined
      FMC_Bank4->PCR4 &= PCR_PBKEN_RESET;
..FWLIBsrcstm32f4xx_fmc.c(809): error:  #20: identifier "FMC_Bank5_6" is undefined
    FMC_Bank5_6->SDCR[FMC_Bank] = 0x000002D0;
..FWLIBsrcstm32f4xx_fmc.c(868): error:  #20: identifier "FMC_Bank5_6" is undefined
      FMC_Bank5_6->SDCR[FMC_SDRAMInitStruct->FMC_Bank] = tmpr1;
..FWLIBsrcstm32f4xx_fmc.c(876): error:  #20: identifier "FMC_Bank5_6" is undefined
      FMC_Bank5_6->SDCR[FMC_Bank1_SDRAM] = tmpr3;
..FWLIBsrcstm32f4xx_fmc.c: 0 warnings, 30 errors

一周热门 更多>