前言
一般來說,通常叫這種已編譯過檔案對控制器來說都叫做韌體firmware (FW),或是映像檔,IMAGE FILE,位元檔,或是BINARY CODE,機器碼...(拉利拉扎的別名還真多.....),通常玩家可以利用CCS在編譯過程中可以"順便"產生出hex檔案,而此處有兩種編譯檔。 一種叫做TI-TXT,另一種叫做INTEL-HEX。
如果選擇TI-TXT 輸出則為副檔名為***.txt
如果選擇INTEL-HEX 輸出則為副檔名為***.hex
將原始c程式碼經過CCS編譯成十六進位TI - Hex檔
說明: 要在Project Perperty選項中
Project → Properties → Build → Build Steps Tab → Post-Build Step → Apply Predefined Step
讓HEX檔案會出現在工作目錄的Debug目錄下,會在這裡找到:
CSSv5.X開發工作目錄有xxx/workspace_v5_x/***/Debug/目錄下
生成檔案會在 <Workspace>\<Project>\Debug\ 目錄底下
咦! TXT是純文字檔嗎 ?? 試著開啟看看***.txt檔是否為HEX格式檔案,如下圖就是HEX碼,都是16進位制。
原文說明
How to Generate Binary Format Files (TI-TXT and INTEL-HEX)
The CCS installation includes the hex430.exe conversion tool. It can be configured to generate output
objects in TI-TXT format for use with the MSP-GANG430 and MSP-PRGS430 programmers, as well as
INTEL-HEX format files for TI factory device programming. The tool can be used either standalone in a
command line (located in <Installation Root>\ccsv5\ccs_base\tools\compiler\msp430\bin) or directly within
CCS. In the latter case, a post-build step can be configured to generate the file automatically after every
build by selecting predefined formats such as TI-TXT and INTEL-HEX in the "Apply Predefined Step"
pulldown menu (Project → Properties → Build → Build Steps Tab → Post-Build Step → Apply Predefined
Step). The generated file is stored in the <Workspace>\<Project>\Debug\ directory.