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).
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. 預處理后的文件 -
.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
、文件,詳細可見博文 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
-
.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) } } 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.
審核編輯 :李倩
-
芯片
+關注
關注
459文章
51860瀏覽量
432874 -
XML
+關注
關注
0文章
188瀏覽量
33437 -
keil
+關注
關注
69文章
1217瀏覽量
168417
原文標題:Keil 項目/生成的各種文件類型(.AXF、.D、.crf、.exf)說明
文章出處:【微信號:技術讓夢想更偉大,微信公眾號:技術讓夢想更偉大】歡迎添加關注!文章轉載請注明出處。
發布評論請先 登錄
相關推薦
頭文件類型定義
Keil uVision 5安裝包下載,詳細安裝教程~
AGM FPGA/MCU燒寫文件類型有哪些及用途
使用stm32cubeMX無法生成mdk工程文件?
labview程序生成exe文件怎么還原
labview工程文件如何生成exe
labview怎么生成可執行文件
怎樣將keil中的程序導出
keil5怎么給ti燒錄程序
Efinity編譯生成文件使用指導-v1

評論