我参考几种新建工程的方法,综合起来,新建了一工程模版。
如下图
添加了STM32F4资料\STM32F4xx_DSP_StdPeriph_Lib_V1.3.0\Libraries\STM32F4xx_StdPeriph_Driver\src\中的库文件,
编译时报错,
报错如下:..\Lib\src\stm32f4xx_fsmc.c(129): error: #20: identifier "FSMC_Bank1" is undefined
FSMC_Bank1->BTCR[FSMC_Bank] = 0x000030DB;
..\Lib\src\stm32f4xx_fsmc.c(134): error: #20: identifier "FSMC_Bank1" is undefined
FSMC_Bank1->BTCR[FSMC_Bank] = 0x000030D2;
..\Lib\src\stm32f4xx_fsmc.c(136): error: #20: identifier "FSMC_Bank1" is undefined
FSMC_Bank1->BTCR[FSMC_Bank + 1] = 0x0FFFFFFF;
..\Lib\src\stm32f4xx_fsmc.c(137): error: #20: identifier "FSMC_Bank1E" is undefined
FSMC_Bank1E->BWTR[FSMC_Bank] = 0x0FFFFFFF;
..\Lib\src\stm32f4xx_fsmc.c(173): error: #20: identifier "FSMC_Bank1" is undefined
FSMC_Bank1->BTCR[FSMC_NORSRAMInitStruct->FSMC_Bank] =
..\Lib\src\stm32f4xx_fsmc.c(210): error: #20: identifier "FSMC_Bank1E" is undefined
FSMC_Bank1E->BWTR[FSMC_NORSRAMInitStruct->FSMC_Bank] =
..\Lib\src\stm32f4xx_fsmc.c(220): error: #20: identifier "FSMC_Bank1E" is undefined
FSMC_Bank1E->BWTR[FSMC_NORSRAMInitStruct->FSMC_Bank] = 0x0FFFFFFF;
..\Lib\src\stm32f4xx_fsmc.c(281): error: #20: identifier "FSMC_Bank1" is undefined
FSMC_Bank1->BTCR[FSMC_Bank] |= BCR_MBKEN_SET;
..\Lib\src\stm32f4xx_fsmc.c(286): error: #20: identifier "FSMC_Bank1" is undefined
FSMC_Bank1->BTCR[FSMC_Bank] &= BCR_MBKEN_RESET;
..\Lib\src\stm32f4xx_fsmc.c(354): error: #20: identifier "FSMC_Bank2" is undefined
FSMC_Bank2->PCR2 = 0x00000018;
..\Lib\src\stm32f4xx_fsmc.c(363): error: #20: identifier "FSMC_Bank3" is undefined
FSMC_Bank3->PCR3 = 0x00000018;
..\Lib\src\stm32f4xx_fsmc.c(422): error: #20: identifier "FSMC_Bank2" is undefined
FSMC_Bank2->PCR2 = tmppcr;
..\Lib\src\stm32f4xx_fsmc.c(429): error: #20: identifier "FSMC_Bank3" is undefined
FSMC_Bank3->PCR3 = tmppcr;
..\Lib\src\stm32f4xx_fsmc.c(481): error: #20: identifier "FSMC_Bank2" is undefined
FSMC_Bank2->PCR2 |= PCR_PBKEN_SET;
..\Lib\src\stm32f4xx_fsmc.c(485): error: #20: identifier "FSMC_Bank3" is undefined
FSMC_Bank3->PCR3 |= PCR_PBKEN_SET;
..\Lib\src\stm32f4xx_fsmc.c(493): error: #20: identifier "FSMC_Bank2" is undefined
FSMC_Bank2->PCR2 &= PCR_PBKEN_RESET;
..\Lib\src\stm32f4xx_fsmc.c(497): error: #20: identifier "FSMC_Bank3" is undefined
FSMC_Bank3->PCR3 &= PCR_PBKEN_RESET;
..\Lib\src\stm32f4xx_fsmc.c(521): error: #20: identifier "FSMC_Bank2" is undefined
FSMC_Bank2->PCR2 |= PCR_ECCEN_SET;
..\Lib\src\stm32f4xx_fsmc.c(525): error: #20: identifier "FSMC_Bank3" is undefined
FSMC_Bank3->PCR3 |= PCR_ECCEN_SET;
..\Lib\src\stm32f4xx_fsmc.c(533): error: #20: identifier "FSMC_Bank2" is undefined
FSMC_Bank2->PCR2 &= PCR_ECCEN_RESET;
..\Lib\src\stm32f4xx_fsmc.c(537): error: #20: identifier "FSMC_Bank3" is undefined
FSMC_Bank3->PCR3 &= PCR_ECCEN_RESET;
..\Lib\src\stm32f4xx_fsmc.c(557): error: #20: identifier "FSMC_Bank2" is undefined
eccval = FSMC_Bank2->ECCR2;
..\Lib\src\stm32f4xx_fsmc.c(562): error: #20: identifier "FSMC_Bank3" is undefined
eccval = FSMC_Bank3->ECCR3;
..\Lib\src\stm32f4xx_fsmc.c(617): error: #20: identifier "FSMC_Bank4" is undefined
FSMC_Bank4->PCR4 = 0x00000018;
..\Lib\src\stm32f4xx_fsmc.c(653): error: #20: identifier "FSMC_Bank4" is undefined
FSMC_Bank4->PCR4 = (uint32_t)FSMC_PCCARDInitStruct->FSMC_Waitfeature |
..\Lib\src\stm32f4xx_fsmc.c(716): error: #20: identifier "FSMC_Bank4" is undefined
FSMC_Bank4->PCR4 |= PCR_PBKEN_SET;
..\Lib\src\stm32f4xx_fsmc.c(721): error: #20: identifier "FSMC_Bank4" is undefined
FSMC_Bank4->PCR4 &= PCR_PBKEN_RESET;
..\Lib\src\stm32f4xx_fsmc.c(767): error: #20: identifier "FSMC_Bank2" is undefined
FSMC_Bank2->SR2 |= FSMC_IT;
..\Lib\src\stm32f4xx_fsmc.c(772): error: #20: identifier "FSMC_Bank3" is undefined
FSMC_Bank3->SR3 |= FSMC_IT;
..\Lib\src\stm32f4xx_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文件从工程中移除后再编译结果如下
..\Output\STM32F429_439xx-DEMO.axf: Error: L6218E: Undefined symbol TimingDelay_Decrement (referred from stm32f4xx_it.o).
我还是个菜鸟,希望有网友能帮我解答一下,谢谢!
附上我的新建的工程,如有配置错误的地方,望各位指点。
本帖最后由 经世致用 于 2013-12-24 14:25 编辑