关于stm32f4xx_fsmc.c编译报错的问题

2019-03-23 15:59发布

本帖最后由 经世致用 于 2013-12-24 14:25 编辑

我参考几种新建工程的方法,综合起来,新建了一工程模版。
如下图
(X~Q)01S0]9B_EAU4C}Q$SH.jpg

添加了STM32F4资料STM32F4xx_DSP_StdPeriph_Lib_V1.3.0LibrariesSTM32F4xx_StdPeriph_Driversrc中的库文件,
编译时报错,
报错如下:..Libsrcstm32f4xx_fsmc.c(129): error:  #20: identifier "FSMC_Bank1" is undefined
      FSMC_Bank1->BTCR[FSMC_Bank] = 0x000030DB;   
..Libsrcstm32f4xx_fsmc.c(134): error:  #20: identifier "FSMC_Bank1" is undefined
      FSMC_Bank1->BTCR[FSMC_Bank] = 0x000030D2;
..Libsrcstm32f4xx_fsmc.c(136): error:  #20: identifier "FSMC_Bank1" is undefined
    FSMC_Bank1->BTCR[FSMC_Bank + 1] = 0x0FFFFFFF;
..Libsrcstm32f4xx_fsmc.c(137): error:  #20: identifier "FSMC_Bank1E" is undefined
    FSMC_Bank1E->BWTR[FSMC_Bank] = 0x0FFFFFFF;  
..Libsrcstm32f4xx_fsmc.c(173): error:  #20: identifier "FSMC_Bank1" is undefined
    FSMC_Bank1->BTCR[FSMC_NORSRAMInitStruct->FSMC_Bank] =
..Libsrcstm32f4xx_fsmc.c(210): error:  #20: identifier "FSMC_Bank1E" is undefined
      FSMC_Bank1E->BWTR[FSMC_NORSRAMInitStruct->FSMC_Bank] =
..Libsrcstm32f4xx_fsmc.c(220): error:  #20: identifier "FSMC_Bank1E" is undefined
      FSMC_Bank1E->BWTR[FSMC_NORSRAMInitStruct->FSMC_Bank] = 0x0FFFFFFF;
..Libsrcstm32f4xx_fsmc.c(281): error:  #20: identifier "FSMC_Bank1" is undefined
      FSMC_Bank1->BTCR[FSMC_Bank] |= BCR_MBKEN_SET;
..Libsrcstm32f4xx_fsmc.c(286): error:  #20: identifier "FSMC_Bank1" is undefined
      FSMC_Bank1->BTCR[FSMC_Bank] &= BCR_MBKEN_RESET;
..Libsrcstm32f4xx_fsmc.c(354): error:  #20: identifier "FSMC_Bank2" is undefined
      FSMC_Bank2->PCR2 = 0x00000018;
..Libsrcstm32f4xx_fsmc.c(363): error:  #20: identifier "FSMC_Bank3" is undefined
      FSMC_Bank3->PCR3 = 0x00000018;
..Libsrcstm32f4xx_fsmc.c(422): error:  #20: identifier "FSMC_Bank2" is undefined
      FSMC_Bank2->PCR2 = tmppcr;
..Libsrcstm32f4xx_fsmc.c(429): error:  #20: identifier "FSMC_Bank3" is undefined
      FSMC_Bank3->PCR3 = tmppcr;
..Libsrcstm32f4xx_fsmc.c(481): error:  #20: identifier "FSMC_Bank2" is undefined
        FSMC_Bank2->PCR2 |= PCR_PBKEN_SET;
..Libsrcstm32f4xx_fsmc.c(485): error:  #20: identifier "FSMC_Bank3" is undefined
        FSMC_Bank3->PCR3 |= PCR_PBKEN_SET;
..Libsrcstm32f4xx_fsmc.c(493): error:  #20: identifier "FSMC_Bank2" is undefined
        FSMC_Bank2->PCR2 &= PCR_PBKEN_RESET;
..Libsrcstm32f4xx_fsmc.c(497): error:  #20: identifier "FSMC_Bank3" is undefined
        FSMC_Bank3->PCR3 &= PCR_PBKEN_RESET;
..Libsrcstm32f4xx_fsmc.c(521): error:  #20: identifier "FSMC_Bank2" is undefined
        FSMC_Bank2->PCR2 |= PCR_ECCEN_SET;
..Libsrcstm32f4xx_fsmc.c(525): error:  #20: identifier "FSMC_Bank3" is undefined
        FSMC_Bank3->PCR3 |= PCR_ECCEN_SET;
..Libsrcstm32f4xx_fsmc.c(533): error:  #20: identifier "FSMC_Bank2" is undefined
        FSMC_Bank2->PCR2 &= PCR_ECCEN_RESET;
..Libsrcstm32f4xx_fsmc.c(537): error:  #20: identifier "FSMC_Bank3" is undefined
        FSMC_Bank3->PCR3 &= PCR_ECCEN_RESET;
..Libsrcstm32f4xx_fsmc.c(557): error:  #20: identifier "FSMC_Bank2" is undefined
      eccval = FSMC_Bank2->ECCR2;
..Libsrcstm32f4xx_fsmc.c(562): error:  #20: identifier "FSMC_Bank3" is undefined
      eccval = FSMC_Bank3->ECCR3;
..Libsrcstm32f4xx_fsmc.c(617): error:  #20: identifier "FSMC_Bank4" is undefined
    FSMC_Bank4->PCR4 = 0x00000018;
..Libsrcstm32f4xx_fsmc.c(653): error:  #20: identifier "FSMC_Bank4" is undefined
    FSMC_Bank4->PCR4 = (uint32_t)FSMC_PCCARDInitStruct->FSMC_Waitfeature |
..Libsrcstm32f4xx_fsmc.c(716): error:  #20: identifier "FSMC_Bank4" is undefined
      FSMC_Bank4->PCR4 |= PCR_PBKEN_SET;
..Libsrcstm32f4xx_fsmc.c(721): error:  #20: identifier "FSMC_Bank4" is undefined
      FSMC_Bank4->PCR4 &= PCR_PBKEN_RESET;
..Libsrcstm32f4xx_fsmc.c(767): error:  #20: identifier "FSMC_Bank2" is undefined
        FSMC_Bank2->SR2 |= FSMC_IT;
..Libsrcstm32f4xx_fsmc.c(772): error:  #20: identifier "FSMC_Bank3" is undefined
        FSMC_Bank3->SR3 |= FSMC_IT;
..Libsrcstm32f4xx_fsmc.c(777): error:  #20: identifier "FSMC_Bank4" is undefined
        FSMC_Bank4->SR4 |= FSMC_IT;   

我看了别人的工程,以前下载的STM32F4xx_StdPeriph_Lib_V1.0.1中没有stm32f4xx_fsmc.c这个文件,
我把这个stm32f4xx_fsmc.c文件从工程中移除后再编译结果如下
..OutputSTM32F429_439xx-DEMO.axf: Error: L6218E: Undefined symbol TimingDelay_Decrement (referred from stm32f4xx_it.o).

我还是个菜鸟,希望有网友能帮我解答一下,谢谢!
附上我的新建的工程,如有配置错误的地方,望各位指点。 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。