keil中编译栏是灰色的+keil中添加C51库+keil中添加ARM库
(2013-12-24 18:28:06)
标签:
keil中编译栏是灰色的keil怎么添加芯片库 |
分类: 嵌入式学习 |
最近很多开始学ARM或51的朋友总问我说为什么编译栏是灰色的。
EXCEPTION 0021H: PATH OR FILE NOT FOUND
FILE: E:\KEIL\C51\LIB\C51FPS.LIB
还有对于一些直接用别人程序的同学也会出现编译上的问题
--- Error: failed to execute 'E:\keil\C51\BIN\C51.EXE'
Target not created
第二个问题是
*** FATAL ERROR L210: I/O ERROR ON
INPUT FILE:
第二个问题的解决方法比较简单,直接下载C51FPS.LIB
http://zhidao.baidu.com/share/f056f2d272beea304f1f5ae0c573b0f7.html
C51FPS.LIB是51单片机生成hex文件时可能需要用到的文件库
今天就说下第一个问题的解决方法
我们Keil要能编译首先要有相对应的库文件,而很多商家提供给大家的MDK都是针对某一类型号芯片(这样软件会比较小)所以我们在用原来的keil建立工程编译其他文件的时候就会显示出错,因为没有对应的库文件
解决方法:
下载相对应的芯片库文件(在官方或者其他地方搜相应的C51或ARM库)
把下载的库添加到自己KEIL的安装文件下面
添加环境变量:用记事本打开tools.ini,添加如下(如果只更改C51就添加C51的就行,下面有ARM的也有ARMDS得)
[C51]
PATH="E:\keil\C51"
BOOK0=HLP\RELEASE_NOTES.HTM("Release Notes")
BOOK1=HLP\GS51.PDF("uVision2 Getting Started")
BOOK2=HLP\C51.PDF("C51 User's Guide")
BOOK3=HLP\C51LIB.CHM("C51 Library Functions",C)
BOOK4=HLP\A51.PDF("Assembler/Utilities")
BOOK5=HLP\TR51.CHM("RTX51 Tiny User's Guide")
BOOK6=HLP\DBG51.CHM("uVision2 Debug Commands")
BOOK7=ISD51\ISD51.HTM("ISD51 In System Debugger")
BOOK8=HLP\FlashMon.CHM("Flash Monitor")
BOOK9=MON390\MON390.HTM("MON390: Dallas Contiguous Mode
Monitor")
TDRV0=BIN\MON51.DLL ("Keil Monitor-51 Driver")
TDRV1=BIN\ISD51.DLL ("Keil ISD51 In-System Debugger")
TDRV2=BIN\MON390.DLL ("MON390: Dallas Contiguous Mode")
TDRV3=BIN\LPC2EMP.DLL ("LPC900 EPM Emulator/Programmer")
RTOS1=RTXTINY.DLL ("RTX-51 Tiny")
RTOS2=RTX51.DLL ("RTX-51 Full")
Version=V7.0
[ARM]
PATH="E:\keil\ARM"
VERSION=4.60
PATH1="C:\Program Files\arm-none-eabi-gcc-4_6"
TOOLPREFIX=arm-none-eabi-
CPUDLL0=SARM.DLL(TDRV0,TDRV5,TDRV6,TDRV10)
# Drivers
for ARM7/9 devices
CPUDLL1=SARMCM3.DLL(TDRV1,TDRV2,TDRV3,TDRV4,TDRV5,TDRV7,TDRV8,TDRV9,TDRV11,TDRV12,TDRV13,TDRV14)
# Drivers for Cortex-M devices
CPUDLL2=SARMCR4.DLL(TDRV7)
# Drivers for Cortex-R4
devices
BOOK0=HLP\RELEASE_NOTES.HTM("Release Notes",GEN)
BOOK1=HLP\ARMTOOLS.chm("Complete User's Guide
Selection",C)
BOOK2=CMSIS\index.html("CMSIS Documentation",GEN)
BOOK3=C:\Program
Files\arm-none-eabi-gcc-4_6\share\doc\pdf\gcc\gcc.pdf("GNU C
Compiler",GEN)
BOOK4=C:\Program
Files\arm-none-eabi-gcc-4_6\share\doc\pdf\as.pdf("GNU
Assembler",GEN)
BOOK5=C:\Program
Files\arm-none-eabi-gcc-4_6\share\doc\pdf\ld.pdf("GNU
Linker",GEN)
BOOK6=C:\Program
Files\arm-none-eabi-gcc-4_6\share\doc\pdf\binutils.pdf("GNU Binary
Utilities",GEN)
BOOK7=Signum\Docs\SigUV3Arm.htm("Signum Systems JTAGjet Driver
Documentation",GEN)
TDRV0=BIN\UL2ARM.DLL("ULINK2/ME ARM Debugger")
TDRV1=BIN\UL2CM3.DLL("ULINK2/ME Cortex Debugger")
TDRV2=BIN\AGDIRDI.DLL("RDI Interface Driver")
TDRV3=BIN\ABLSTCM.dll("Altera Blaster Cortex Debugger")
TDRV4=BIN\lmidk-agdi.dll("Stellaris ICDI")
TDRV5=Signum\SigUV3Arm.dll("Signum Systems JTAGjet")
TDRV6=Segger\JLTAgdi.dll("J-LINK / J-TRACE ARM")
TDRV7=Segger\JL2CM3.dll("J-LINK / J-TRACE Cortex")
TDRV8=STLink\ST-LINKIII-KEIL.dll ("ST-Link (Deprecated
Version)")
TDRV9=BIN\ULP2CM3.DLL("ULINK Pro Cortex Debugger")
TDRV10=BIN\ULP2ARM.DLL("ULINK Pro ARM Debugger")
TDRV11=NULink\Nu_Link.dll("NULink Debugger")
TDRV12=SiLabs\SLAB_CM_Keil.dll("SiLabs UDA Debugger")
TDRV13=STLink\ST-LINKIII-KEIL_SWO.dll ("ST-Link
Debugger")
TDRV14=BIN\CMSIS_AGDI.dll("CMSIS-DAP Debugger")
DELDRVPKG0=ULINK\UninstallULINK.exe("ULINK Pro Driver
V1.0")
LIC0=HN0Z9-4AWQS-NAQDU-SYVTM-1FV81-IEIPR
[ARMADS]
PATH="E:\keil\ARM"
PATH1=".\ARMCC\bin"
CPUDLL0=SARM.DLL(TDRV0,TDRV5,TDRV6,TDRV10)
# Drivers
for ARM7/9 devices
CPUDLL1=SARMCM3.DLL(TDRV1,TDRV2,TDRV3,TDRV4,TDRV5,TDRV7,TDRV8,TDRV9,TDRV11,TDRV12,TDRV13,TDRV14)
# Drivers for Cortex-M devices
CPUDLL2=SARMCR4.DLL(TDRV7)
# Drivers for Cortex-R4
devices
BOOK0=HLP\RELEASE_NOTES.HTM("Release Notes",GEN)
BOOK1=HLP\ARMTOOLS.chm("Complete User's Guide
Selection",C)
BOOK2=CMSIS\index.html("CMSIS Documentation",GEN)
BOOK3=Signum\Docs\SigUV3Arm.htm("Signum Systems JTAGjet Driver
Documentation",GEN)
TDRV0=BIN\UL2ARM.DLL("ULINK2/ME ARM Debugger")
TDRV1=BIN\UL2CM3.DLL("ULINK2/ME Cortex Debugger")
TDRV2=BIN\AGDIRDI.DLL("RDI Interface Driver")
TDRV3=BIN\ABLSTCM.dll("Altera Blaster Cortex Debugger")
TDRV4=BIN\lmidk-agdi.dll("Stellaris ICDI")
TDRV5=Signum\SigUV3Arm.dll("Signum Systems JTAGjet")
TDRV6=Segger\JLTAgdi.dll("J-LINK / J-TRACE ARM")
TDRV7=Segger\JL2CM3.dll("J-LINK / J-Trace Cortex")
TDRV8=STLink\ST-LINKIII-KEIL.dll ("ST-Link (Deprecated
Version)")
TDRV9=BIN\ULP2CM3.DLL("ULINK Pro Cortex Debugger")
TDRV10=BIN\ULP2ARM.DLL("ULINK Pro ARM Debugger")
TDRV11=NULink\Nu_Link.dll("NULink Debugger")
TDRV12=SiLabs\SLAB_CM_Keil.dll("SiLabs UDA Debugger")
TDRV13=STLink\ST-LINKIII-KEIL_SWO.dll ("ST-Link
Debugger")
TDRV14=BIN\CMSIS_AGDI.dll("CMSIS-DAP Debugger")
RTOS0=Dummy.DLL("Dummy")
RTOS1=VARTXARM.DLL ("RTX Kernel")
DELDRVPKG0=ULINK\UninstallULINK.exe("ULINK Pro Driver
V1.0")
这些环境变量要对应自己下载的芯片库,因为有的是没有的
还有PATH="E:\keil\C51"要改为自己电脑的路径,我的keil是安装在E盘的
然后重新打开keil,就可以新建工程编译运行了