(原创)MDK uVision4中常见错误

标签:
stm32uvisoin4常见错误arm32位错误总结 |
分类: 知识 |
1、工程中组文件中没加入库函数:STM32F10xR.LIB
错误现象:
.\out\STM32_3.2_LCD.axf: Error: L6218E: Undefined symbol
GPIO_ResetBits (referred from lcd.o).
.\out\STM32_3.2_LCD.axf: Error: L6218E: Undefined symbol
GPIO_SetBits (referred from lcd.o).
.\out\STM32_3.2_LCD.axf: Error: L6218E: Undefined symbol
FLASH_PrefetchBufferCmd (referred from main.o).
.\out\STM32_3.2_LCD.axf: Error: L6218E: Undefined symbol
FLASH_SetLatency (referred from main.o).
.\out\STM32_3.2_LCD.axf: Error: L6218E: Undefined symbol
GPIO_Init (referred from main.o).
.\out\STM32_3.2_LCD.axf: Error: L6218E: Undefined symbol
GPIO_PinRemapConfig (referred from main.o).
.\out\STM32_3.2_LCD.axf: Error: L6218E: Undefined symbol
GPIO_Write (referred from main.o).
、、、、、、、、、、
解决方法:1、点击http://s4/small/006avBdLzy77XoE0Dkf43&690uVision4中常见错误" TITLE="(原创)MDK uVision4中常见错误" />,在Project
Components下,最右边的Files中添加库函数。
2、或者在工作区左边的工作组中点击右键,选择Add Files to Group" XX",选择库文件添加。
2、工程中没有添加启动文件:STM32F10x.s
错误现象:
.\out\STM32_3.2_LCD.axf: Error: L6320W: Ignoring --entry
command. Cannot find argument 'Reset_Handler'.
.\out\STM32_3.2_LCD.axf: Warning: L6320W: Ignoring --first
command. Cannot find argument '__Vectors'.
解决方法:1、点击http://s4/small/006avBdLzy77XoE0Dkf43&690uVision4中常见错误" TITLE="(原创)MDK uVision4中常见错误" />,在Project
Components下,最右边的Files中添加启动文件。
2、或者在工作区左边的工作组中点击右键,选择Add Files to
Group" XX",选择加入启动文件。
3、点C文件中没有加入头文件:#include "stm32f10x_rcc.h"、#include
"stm32f10x_gpio.h"
#include
"stm32f10x_flash.h"、、、、、、、等等
错误现象:
main.c(49): warning: #223-D:
function "RCC_APB2PeriphClockCmd" declared implicitly
main.c(49): error:
#20: identifier "RCC_APB2Periph_GPIOA" is
undefined
main.c(49): error:
#20: identifier "RCC_APB2Periph_GPIOB" is
undefined
main.c(49): error:
#20: identifier "RCC_APB2Periph_AFIO" is
undefined
main.c(165): warning:
#223-D: function "RCC_DeInit" declared
implicitly
main.c(168): warning:
#223-D: function "RCC_HSEConfig" declared
implicitly
main.c(168): error:
#20: identifier "RCC_HSE_ON" is undefined
main.c(171): warning:
#223-D: function "RCC_WaitForHSEStartUp" declared
implicitly
main.c(171): warning:
#188-D: enumerated type mixed with another
type
main.c(176): warning:
#223-D: function "FLASH_PrefetchBufferCmd"
declared implicitly
main.c(176): error:
#20: identifier "FLASH_PrefetchBuffer_Enable" is
undefined
main.c(179): warning:
#223-D: function "FLASH_SetLatency" declared
implicitly
main.c(179): error:
#20: identifier "FLASH_Latency_2" is
undefined
main.c(182): warning:
#223-D: function "RCC_HCLKConfig" declared
implicitly
main.c(182): error:
#20: identifier "RCC_SYSCLK_Div1" is
undefined
main.c(185): warning:
#223-D: function "RCC_PCLK2Config" declared
implicitly
main.c(185): error:
#20: identifier "RCC_HCLK_Div1" is
undefined
解决方法:在对应点C文件中加入头文件。
4、工程中不小心删掉一个点C文件:比如LCD.c
错误现象:
.\out\STM32_3.2_LCD.axf: Error: L6218E:
Undefined symbol ChineseChar (referred from main.o).
.\out\STM32_3.2_LCD.axf: Error:
L6218E: Undefined symbol LCD_Init (referred from main.o).
.\out\STM32_3.2_LCD.axf: Error:
L6218E: Undefined symbol LCD_ShowChar (referred from main.o).
.\out\STM32_3.2_LCD.axf: Error:
L6218E: Undefined symbol LCD_ShowString (referred from
main.o).
.\out\STM32_3.2_LCD.axf: Error:
L6218E: Undefined symbol Pant (referred from main.o).
.\out\STM32_3.2_LCD.axf: Error:
L6218E: Undefined symbol colors (referred from main.o).
.\out\STM32_3.2_LCD.axf: Error:
L6218E: Undefined symbol delayms (referred from main.o).
解决方法:加入对应的文件。参考1。
前一篇:[转载]常用数组排序算法