当前位置:网站首页>Intel hex, Motorola S-Record format detailed analysis
Intel hex, Motorola S-Record format detailed analysis
2022-06-30 02:47:00 【CDamogu】

Catalog
The overview
| Intel-HEX | : | Count | Address | Type | Data | CheckSum |
|---|---|---|---|---|---|---|
| Description | Line start | Byte1 Data length of this line | Byte2 Byte3 The starting address of the bank's data | 00 Record data ,hex Most of the records of the file are data records 01 End of identification file , At the end of the file , Express Hex The end of the document 02 A record that identifies the extension segment address 03 Start segment address record 04 Identify records that extend linear addresses 05 Start linear address recording | data | 0x100- Cumulative sum |
| Example | : | 1byte | 2bytes | 1bytes | n bytes | 1 byte |
| : | 02 | 0000 | 04 | 00C3 | 37 | |
| : | 20 | 0020 | 00 | FAC3… | CB | |
| : | 00 | 0000 | 01 | FF | ||
| Motorola S-Record | Type | Count | Address | Data | CheckSum | |
| Description | S0 The address field is not used , Set with zero (0x0000) S1 The address is 2 Byte record S2 The address is 3 Byte record S3 The address is 4 Byte record S5 Mark this document with S1,S2,S3 The number of S7 The address is 4 byte , Indicates the starting execution address of the program , The data part is not used , This line indicates the end of the program , No need to download to MCU S8 The address is 3 byte , Indicates the starting execution address of the program , The data part is not used , This line indicates the end of the program , No need to download to MCU S9 The address is 2 byte , Indicates the starting execution address of the program , The data part is not used , This line indicates the end of the program , No need to download to MCU | Record length = Number of bytes of storage address + Number of data bytes + Number of checksum bytes s19 It's all except S0-9 The length of | Storage address , Bytes by Type decision , Indicates the starting address where the data should be loaded | data | 0x100- Cumulative sum | |
| Example | S3 | 21(33) | 0000001C(4Byte) | 007D00…(33-4-1byte) | E6(1Byte) | |
| S7 | 05 | 00000000 | FA |
S19
S-record The format file is Freescale CodeWarrior The compiler generated suffix is .S19 Program file , It is a paragraph written directly into MCU Of ASCII code , English full name ask Motorola format for EEPROM programming.
1、 Format definition and meaning
S-record The maximum of each line is 78 Bytes ,156 Characters
S-record format
type count address data checksum
type( type ):2 Characters . Used to describe the type of record (S0,S1,S2,S3,S5,S7,S8,S9).
count( Count ):2 Characters . Used to form and describe a 16 The value of base , Shows the count of the remaining paired characters in the record .
address( Address ):4 or 6 or 8 Bytes . Used to form and describe a 16 The value of base , It shows the address where the data should be loaded , The length of this part depends on the number of bytes of the load address .2 The address of bytes takes up 4 Characters ,3 The address of bytes takes up 6 Characters ,4 The address of bytes takes up 8 Characters .
data( data ):0—64 character . It is used to compose and describe a that represents the memory loaded data or description information 16 The value of base .
checksum( The checksum ):2 Characters . These characters should be paired and converted into 16 Hexadecimal data when forming a least significant character section , This character section is used to express as supplementary data , The address and database character pairs represent ( Bytes of ) Complement byte The sum of the . That is, the count value 、 Several characters of address field and data field are paired with two characters , Add them together and sum them up , The overflow portion of and is not counted , Only the minimum two characters are reserved NN,checksum =0xFF-0xNN.
S0 Record: The type of record is “S0” (0x5330). The address field is not used , Set with zero (0x0000). The information in the data field is divided into the following four sub domains :
name( name ):20 Characters , Used to encode unit names
ver( edition ):2 Characters , Used to encode the version number
rev( Revision ):2 Characters , Used to code the revision number
description( describe ):0-36 Characters , Used to encode text notes
This line indicates the beginning of the program , No need to burn memory.
S1 Record: The type of record is “S1” (0x5331). The address field consists of 2 Byte address to illustrate . Data fields consist of loadable data .
S2 Record: The type of record is “S2” (0x5332). The address field consists of 3 Byte address to illustrate . Data fields consist of loadable data .
S3 Record: The type of record is “S3” (0x5333). The address field consists of 4 Byte address to illustrate . Data fields consist of loadable data .
S5 Record: The type of record is “S5” (0x5335). The address field consists of 2 Byte value description , Contains the previously transmitted S1、S2、S3 Recorded count .
No data fields .
S7 Record: The type of record is “S7” (0x5337). The address field consists of 4 Address description of bytes , Contains the start address . No data fields . This line indicates the end of the program , No need to burn memory.
S8 Record: The type of record is “S8” (0x5338). The address field consists of 3 Address description of bytes , Contains the start address . No data fields . This line indicates the end of the program , No need to burn memory.
S9 Record: The type of record is “S9” (0x5339). The address field consists of 2 Address description of bytes , Contains the start address . No data fields . This line indicates the end of the program , No need to burn memory.
According to different description information , Choose one of the three different ending lines above to use
2、EXAMPLE
2.1 example I

S19 First line of document : S021000036384B50524F47202020313143524541544544204259204541535936384B6D
The first line of translation information : S0 0000 6 8 K P R O G 1 1 C R E A T E D B Y E A S Y 6 8 K
Color block legend :module name version number revision number checksum
checksum The algorithm of :
0x21+0x00+0x00+0x36+0x38+0x4B+0x50+0x52+0x4F+0x47+0x20+0x20+0x20+0x31+0x31+0x43+0x52+0x45+0x41+0x54+0x45+0x44+0x20+0x42+0x59+0x20+0x45+0x41+0x53+0x59+0x36+0x38+0x4B=0x792
checksum=0xFF-0x92=6D
Be careful :EASy68K Always use S8 record As a closing line .

2.2 example II
S123C000CF1400790011CC09395B105A124A8046304A8000300001C01BCB73140007340027
Color block legend :type count address data checksum
2.3 example III
S224308000C61E877C1516C6197B151ACE04C07E15187A153EC74A90F9301D026A01C6017BF0
Color block legend :type count address data checksum
3、 Attached separately Freescale HCS12DP256B 16 Bit single-chip empty program S19 file :
S0520000453A5C576F6F64795C4C6561726E696E675C50726F6772616D6D655C42444DD2FDB5BCB3CCD0F25C44556D795C447032 35365C62696E5C48435331325F53657269616C5F4D6F6E69746F722E6162735A
S123C000CF1100790011CC09395B105A124A8004304A8000300000C01BC01F00000000001B
S104C020001B
S105FFFEC0003D
S22430800010EF20FEFEC017FDC015270E35ED31EC3169700434FB310326F2FEC019EC31274F
S2113080200BED31180A30700434F920F10AE7
S804000000FB
You can try to understand .
边栏推荐
- 多卡服务器使用
- CMake教程系列-02-使用cmake代碼生成二進制
- 代码签名、驱动签名的常见问题解答
- Raii memory management
- Entering Jiangsu writers and poets carmine Jasmine World Book Day
- 可视化HTA窗体设计器-HtaMaker 界面介绍及使用方法,下载 | HTA VBS可视化脚本编写
- Global and Chinese market for defense network security 2022-2028: Research Report on technology, participants, trends, market size and share
- oracle怎么设置密码复杂度及超时退出的功能
- Precautions for purchasing wildcard SSL certificate
- HTA入门基础教程 | VBS脚本的GUI界面 HTA简明教程 ,附带完整历程及界面美化
猜你喜欢

IDEA 远程调试 Remote JVM Debug

Wechat applet page Jump and parameter transfer

如何在 JupyterLab 中把 ipykernel 切换到不同的 conda 虚拟环境?

Three solutions to forced hibernation of corporate computers

什么是证书透明度CT?如何查询CT logs证书日志?

打造创客教育中精湛技艺

What are the requirements for NPDP product manager international certification examination?

Unity timeline data binding

JMeter obtains cookies across thread groups or JMeter thread groups share cookies

Merge sort
随机推荐
HTA入门基础教程 | VBS脚本的GUI界面 HTA简明教程 ,附带完整历程及界面美化
Jupyter notebook显示k线图集合
什么是证书透明度CT?如何查询CT logs证书日志?
Five cheapest wildcard SSL certificate brands
Recursion frog jumping steps problem
Lua 基础知识
How to prevent phishing emails? S/mime mail certificate
Raki's notes on reading paper: named entity recognition as dependency parsing
Unity3D UGUI强制刷新Layout(布局)组件
Xunwei NXP itop-imx6 development platform
【npm】解决使用npm安装TypeORM的报错问题
NPDP产品经理国际认证考试报名有什么要求?
LeetCode 3. Longest substring without duplicate characters
[on] [DSTG] dynamic spatiotemporalgraph revolutionary neural networks for traffic data impact
代码签名、驱动签名的常见问题解答
2. < tag dynamic programming and 0-1 knapsack problem > lt.416 Split equal sum subset + lt.1049 Weight of the last stone II
Seven common errors of SSL certificate and their solutions
IBM WebSphere channel connectivity setup and testing
Call collections Sort() method, compare two person objects (by age ratio first, and by name ratio for the same age), and pass lambda expression as a parameter.
C console format code