S-Records & Intel-HEX

轉載自:http://ooooooo.blogbus.com/logs/2005/08/1361958.html

s-records原來是Motorola推出的一種標準文件格式。用來將數據從pc flash到目標平臺,這在嵌入式上廣爲應用。

大致說一下s-records的格式:

  • s-records是文本文件格式的;
  • 每一行都是一個s-records紀錄;
  • 每一行的開頭都是大寫的S;加上後面的一個數字,代表當前紀錄的類型;

ps:ihex 也就是Intel HEX文件格式和s-records類似,也是用來下載代碼的一種文件格式

算了,還是把從網上得到的格式文檔拷貝過來吧(http://www.amelek.gda.pl/avr/uisp/srecord.htm):

The general format of an S-record follows:

+-------------------//------------------//-----------------------+
| type | count | address  |            data           | checksum |
+-------------------//------------------//-----------------------+

type -- A char[2] field. These characters describe the type of record (S0, S1, S2, S3, S5, S7, S8, or S9).

count -- A char[2] field. These characters when paired and interpreted as a hexadecimal value, display the count of remaining character pairs in the record.

address -- A char[4,6, or 8] field. These characters grouped and interpreted as a hexadecimal value, display the address at which the data field is to be loaded into memory. The length of the field depends on the number of bytes necessary to hold the address. A 2-byte address uses 4 characters, a 3-byte address uses 6 characters, and a 4-byte address uses 8 characters.

data -- A char [0-64] field. These characters when paired and interpreted as hexadecimal values represent the memory loadable data or descriptive information.

checksum -- A char[2] field. These characters when paired and interpreted as a hexadecimal value display the least significant byte of the ones complement of the sum of the byte values represented by the pairs of characters making up the count, the address, and the data fields.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章