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

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

Project Files
项目文件主要是通过 Keil 创建项目(工程)时生成的各种文件,这些文件记录项目(工程)的各种信息。

.OPT: Project Option file with options (debugger settings, current open files, screen positions, and so on) from older µVision versions. This file is read and transformed into a .UVOPT or .UVOPTX file type by µVision. Keil早期版本使用的项目配置选项文件,已经被新的文件替代(具体见下面的说明)。
.UVGUI[.user-name]:µVision4 Project screen layout file. The extension [.user-name] is added when working in a work-group environment. When this file is missing, the default layout is used. This file is not mandatory. µVision4 窗口布局文件。即:使用者在调整了Keil中各窗口布局后,再次打开Keil会保持之前的修改,修改就是记录在该文件中。
.UVGUIX[.user-name]:µVision5 Project screen layout file. The extension [.user-name] is added when working in a work-group environment. When this file is missing, the default layout is used. This file is not mandatory. µVision5 窗口布局文件,XML格式,记录了MDK软件的GUI布局,如代码编辑区窗口的大小、编译输出提示窗口的位置等等。
.UVMPW:µVision4 Project file for Multiple Projects. Contains references to other project files and binds them into one project. The file is mandatory when multiple projects are grouped into one project. Has an XML structure and can be shared in a work-group.
.UVPROJ: µVision4 Project File. Contains the project structure in XML format. This mandatory file can be shared in a work-group. Keil µVision4 的项目文件,它使用了XML格式记录了工程结构,双击它可以打开整个工程。
.UVPROJX: µVision5 Project File. Contains the project structure in XML format. This mandatory file can be shared in a work-group.Keil µVision5 的项目文件,它使用了XML格式记录了工程结构,就是我们平时双击打开的工程文件,它记录了整个工程的结构,如芯片类型、工程包含了哪些源文件等内容。
.UVOPT: µVision4 project options. Contains the settings for the debugger, trace configuration, breakpoints, currently open files, … . This mandatory XML file can be shared in a work-group. Keil µVision4项目配置文件,XML格式,包括调试配置、跟踪信息配置、断点等。
.UVOPTX:µVision5 project options. Contains the settings for the debugger, trace configuration, breakpoints, currently open files, … . This mandatory XML file can be shared in a work-group. Keil µVision5项目配置文件,记录了工程的配置选项,如下载器的类型、变量跟踪配置、断点位置以及当前已打开的文件等等。
.UV2: µVision3 Project File. Open the files with a later µVision version to convert the file to a new project type.
具体见下图 


Source Files
源码文件应该没啥可说的。表示了Keil 所支持的源码文件类型(支持代码高亮、错误提示等)。

.A51:Assembler source file.
.A66:Assembler source file.
.C:C source file.
.CPP:C++ source file.
.H:C header file (used with #include).
.INC:Assembler include file (used with $include). 汇编语言的头文件(使用”$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:Listing file of the Linker.
.I: C Preprocessor Output File. 预处理后的文件
.LST:Listing file generated by the C Compiler or Assembler. C及汇编编译器产生的列表文件。
.MAP:Listing 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).
.D: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.
.LIB:Library object file. (静态)连接库文件。
.OBJ: Relocatable object file.
.O:Relocatable object files.编译器输出的各种重定位文件,供连接器使用产生可执行文件。
.SBR:Source Browser Information file generated by the Linker/Locater.
关于该部分的.ELF、.AXF、.HEX、文件,详细可见博文ARM之镜像文件/可执行文件/ELF文件/对象文件。

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();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
.dbgconf:Pack 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/docs/ulinkpro/ulinkpro_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.
.LIN:Linker control file.
.LNP:Linker 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.
.PLG:Protocol 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.
.SCT:Linker 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)
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
.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
 

转自:https://blog.csdn.net/ZCShouCSDN/article/details/81354197

猜你喜欢

转载自blog.csdn.net/phenixyf/article/details/87889289
今日推荐