您的位置:首页 > 其它

S-Records & Intel-HEX

2006-01-11 23:49 323 查看
转载自: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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: