谷动谷力

 找回密码
 立即注册
查看: 1404|回复: 1
打印 上一主题 下一主题
收起左侧

Keil 项目/生成的各种文件类型(.AXF、.D、.crf、.exf)说明

[复制链接]
跳转到指定楼层
楼主
发表于 2023-1-3 22:27:45 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 sunsili 于 2023-1-3 22:46 编辑

Keil 项目/生成的各种文件类型(.AXF、.D、.crf、.exf)说明

Keil 是 ARM 推出(收购)的针对 Cortex-M 系列等低功耗芯片芯片的集成开发环境的品牌名称。目前 Keil 的最新版本为 μVision5。旧版本的 Keil 目前使用的已经非常少了,当前使用主要以 μVision4 和 μVision5 这两个版本为主。在使用 Keil 时,Keil 构建项目时会产生很多扩展名的文件,了解各文件的作用对于深入研究编译有很大帮助(主要是各种编译输出文件)。例如,.map文件就是个非常有必要在项目开发阶段实时查看,并且深入研究的文档。同样,其他文件将是深入研究时有效的参考。??随着 Keil 的升级,各种文件在不同版本可能有区别。部分文件在高版本中已经弃用,或者被新的文件代替。具体见下文的说明。适用范围包括 Keil 全部产品:MDK-ARM、C51、C166、C251。
严格来说,以下部分文件不应该算是 Keil 的文件,因为他们是由编译器产生的,而 Keil 就是个 IDE,ARM 公司除了提供了各种方便的 IDE 之外,还提供独立版的编译套件,可以方便的在命令行中使用。

Project Files

项目文件主要是通过 Keil 创建项目(工程)时生成的各种文件,这些文件记录项目(工程)的各种信息。在使用 Keil 打开项目时,Keil 会使用这些文件。
  • .OPT: Keil 早期版本使用的项目配置选项文件,已经被新的文件替代(具体见下面的说明)。
  • .UVGUI[.user-name]:μVision4 窗口布局文件。即:使用者在调整了Keil 中各窗口布局后,再次打开 Keil 会保持之前的修改,修改就是记录在该文件中。
  • .UVGUIX[.user-name]:μVision5 窗口布局文件,XML格式,记录了 MDK 软件的 GUI 布局,如代码编辑区窗口的大小、编译输出提示窗口的位置等等。
  • .UVMPW:用于多个项目的 μVision4 项目文件(工作空间项目文件)。包含对其他项目文件的引用,并将它们绑定到一个项目中。当多个项目分组到一个项目中时,该文件是必需的。具有 XML 结构,可以在工作组中共享。
  • .UVPROJ: Keil μVision4 的项目文件,它使用了 XML 格式记录了工程的结构,双击它可以打开整个工程。
  • .UVPROJX: Keil μVision5 的项目文件,它使用了 XML 格式记录了工程的结构,就是我们平时双击打开的工程文件,它记录了整个工程的结构,如芯片类型、工程包含了哪些源文件等内容。
  • .UVOPT: Keil μVision4 项目配置文件,XML 格式,包括调试配置、跟踪信息配置、断点等。
  • .UVOPTX:Keil μVision5 项目配置文件,记录了工程的配置选项,如下载器的类型、变量跟踪配置、断点位置以及当前已打开的文件等等。
  • .UV2: μVision3 项目文件。使用更高版本的 μVision 打开文件,将文件转换为新的项目类型。

具体见下图:

Source Files

源码文件应该没啥可说的。表示了Keil 所支持的源码文件类型(支持代码高亮、错误提示等)。
  • .A51:汇编源码文件
  • .A66:汇编源码文件
  • .C:C 语言源码文件
  • .CPP:C++ 语言源码文件
  • .H:C/C++ 语言的头文件
  • .INC:汇编语言的头文件(使用"$include"来包含)
  • .S:Assembler source file (typical used for ARM source files).
  • .SRC:Other source file generated by the C compiler.

Listing Files

这部分主要是一些由编译器和连接器输出的中间文件,对于研究编译过程非常有帮助。
  • .COD:Complete program listing file. Includes mixed C and Assembly code. All references are resolved and addresses are fixed-up.
  • .HTM:链接器的列表文件。
  • .I: C Preprocessor Output File. 预处理后的文件
  • .LSTisting file generated by the C Compiler or Assembler. C及汇编编译器产生的列表文件。
  • .MAPisting file (or Map file) generated by the Linker. 这个文件还是非常有用的。我们查看编译信息利器。
  • .M51: Listing file (or Map file) generated by the Linker.
  • .M66: Listing file (or Map file) generated by the Linker.
  • .SCR: Linker scatter loader file. Generated by the Linker. Can be altered manually.链接器产生的分散加载文件。通常会使用手动指定的.sct文件.

Keil 中可以通过如下配置,来输出其中的某些文件


用户在选择了这些条目之后,其实就是在命令行工具中增加对应的参数。例如连接器参数

Object and HEX Files

这部分主要是编译器输出(连接器输出)的各种编译后的文件,包括可执行文件、库文件、对象文件等。
  • .(no extension): Absolute Object File (executable programs generated by the Linker).
  • .AXF:Absolute and executable object file generated by the Linker. (连接器产生)可执行文件(ELF文件格式),该格式文件包含大量调试信息。
  • .Bxx:Absolute object file generated by OC51 for individual code banks (xx may be from 00 to 31).
  • .Dependency file generated by the ARMCC or GCC compiler.描述了对应.o的依赖的文件
  • .CRF:Cross-Reference file containing browse information (definitions, references for identifiers). 交叉引用文件,它主要包含了浏览信息(browse information),即源代码中的宏定义、变量及函数的定义和声明的位置。,可由上图中的Listing标签配置产生。??我们在代码编辑器中右键菜单"Go To Definition Of ‘xxxx’"的时候,,MDK就是通过*.crf文件查找出跳转位置的。该文件使用了特定的格式,具体如下
  • .ELF:ELF/DWARF files generated by the Linker/Locater.
  • .HEX:Intel Hex file, generated by the Object-Hex Conversion Utility. 在单片机中常用,MDK中很少用。
  • .H86:Intel Hex file, generated by the Object-Hex Conversion Utility.
  • .LIBibrary object file. (静态)连接库文件。
  • .OBJ: Relocatable object file.
  • .O:Relocatable object files.编译器输出的各种重定位文件,供连接器使用产生可执行文件。
  • .SBR:Source Browser Information file generated by the Linker/Locater.

关于该部分的.ELF、.AXF、.HEX、文件,详细可见博文 ELF文件、镜像(Image)文件、可执行文件、对象文件 详解

Build Files

  • .BAT:batch file that re-creates a project from the command prompt. μVision may create a batch file when Project - Output - Create Batch File is enabled. 构建项目的批处理文件。在 Keil 中可以选择产生这个文件,主要是在命令行中使用。
  • ._IA, *.__I, *._II, *.SCR: tool invocation files.

Debugger Files
调试文件没啥可说的。
  • .INI:Source code file used typically for initializing the debugger. 这个文件在使用在线调试和Trace时经常用到。可以通过 Keil 的如下界面使用 常用的功能如下:

// 在线调试时使用
LOAD %L INCREMENTAL

// 在使用Keil的Trace功能时使用
///*-------------------------------------------------------------------
//** Define the function to enable the trace port
//**-----------------------------------------------------------------*/
//FUNC void EnableTPIU(void) {

// _WDWORD(0xE0042004, 0x000000E0);   // Set 4-pin tracing via DBGMCU_CR
//}

///*-------------------------------------------------------------------
//** Invoke the function at debugger startup
//**-----------------------------------------------------------------*/
//EnableTPIU();
12345678910111213141516
  • .dbgconfack options (available for some devices) define default configuration settings for debugging, tracing, or Flash programming and are applied to the options in the dialogs Debug, Trace, and Flash Download. Possibly, not all options have been set. Hence, verify the settings and adapt the configuration when needed.关于这部分,详细参见 Keil 官网文章http://www.keil.com/support/man/ ... inkpro_ctx_pack.htm

Other Files

在部分文件有的是编译器输出,有的是Keil输出的。
  • .BUILD_LOG.HTM: Build Log file of the latest project build.
  • .CDB: μVision Device Database file.
  • .DEP: Dependency file for a target build. 整个工程的依赖文件
  • .IC: Intermediate C source file created by the EC++ Compiler.
  • .LINinker control file.
  • .LNPinker Input file generated by μVision to be passed to the command line.
  • .ORC: Global Register Coloring file for optimization.
  • .PACK:Software Pack file. Zip-file containing the software and one *.PDSC description file. Mechanism file to distribute device support, Software Components, APIs, and example projects. 存在于 Keil-MDK 5 中
  • .PDSC: Pack Description file. Describes the content of a Software Pack and dependencies to devices, processors, tool chains, or other software components.
  • .PLGrotocol file that summarizes the last build process.
  • PROJECT_GUI.XSD:XML schema file describing the *.UVGUI file structure. Located in the \UV4 folder.
  • PROJECT_MPW.XSD:XML schema file describing the *.UVMPW file structure. Located in the \UV4 folder.
  • PROJECT_OPT.XSD:XML schema file describing the *.UVOPT file structure. Located in the \UV4 folder.
  • PROJECT_PROJ.XSD:XML schema file describing the *.UVPROJ file structure. Located in the \UV4 folder.
  • .SCTinker control file (scatter loading). 分散加载文件,这个文件非常有用,也非常值得研究研究。下面是个相对来说复杂点的分散加载文件:

LR_IROM1 0x08003000 0x00005000 {   ; load region size_region
ER_IROM1 0x08003000 0x00005000 { ; load address = execution address
  *.o (RESET, +First); 中断向量表
}

ER_IROM2 + 0 {; 应用程序信息
  *.o (SECTION_APP_INFO, +First)
}

ER_IROM3 + 0 {; 初始化相关代码+其他代码
  *(InRoot$$Sections); 初始化相关
  .ANY (+RO); 其他所有代码
}

RW_IRAM1 0x20000000 0x00001800 { ; 内存
  *.o (SECTION_APP_VECTOR, +First)/* APP的中断向量表 */
  .ANY (+RW +ZI)
}
}
12345678910111213141516171819
  • .SCVD: XML schema file for the Component Viewer (System Component Viewer Description file). The file is provided by the vendor or can be build by the user.
  • .UVL:Signal definition file. Saves the signals that have been defined in the Logic Analyzer.
  • .UVLA:File to store signals that have been recorded with the Logic Analyzer.
  • .UVTSK:Event Viewer file. Saves the recorded task-switching events.
  • .SFD: Intermediary pseudo-XML file used to create an .SFR file (.SVD.XML files are used as input).
  • .SFR:Binary file that stores information which is read by the System Viewer.
  • .SVD.XML, *.SVD, *.XML:CMSIS-XML file formats describing the device (CMSIS System View Description file). The file is provided by the vendor.
  • .XSD: XML schema description file.

参考文档

http://www.keil.com/support/man/docs/uv4/uv4_b_filetypes.htm
+10
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|深圳市光明谷科技有限公司|光明谷商城|Sunshine Silicon Corpporation ( 粤ICP备14060730号|Sitemap

GMT+8, 2024-5-13 17:56 , Processed in 0.092995 second(s), 45 queries .

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表