当前位置:网站首页>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 .
边栏推荐
- Multi card server usage
- 怎么利用Redis实现点赞功能
- Raii memory management
- Time complexity analysis
- Azure 开发者新闻快讯丨开发者6月大事记一览
- Summary of knowledge points about eigenvalues and eigenvectors of matrices in Chapter 5 of Linear Algebra (Jeff's self perception)
- Implementation of Sanzi chess with C language
- oracle怎么设置密码复杂度及超时退出的功能
- Two methods of SSL certificate format conversion
- 论文回顾:Playful Palette: An Interactive Parametric Color Mixer for Artists
猜你喜欢

Steam elements hidden in science and Technology Education

Digicert、Sectigo、Globalsign代码签名证书的区别

公司电脑强制休眠的3种解决方案

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

SSL证书七大常见错误及解决方法

What is digicert smart seal?

Playful palette: an interactive parametric color mixer for artists

DigiCert Smart Seal是什么?

Detailed explanation of minimum stack
![[on] [DSTG] dynamic spatiotemporalgraph revolutionary neural networks for traffic data impact](/img/c3/f9d6399c931a006ca295bb1e3ac427.png)
[on] [DSTG] dynamic spatiotemporalgraph revolutionary neural networks for traffic data impact
随机推荐
【npm】解决使用npm安装TypeORM的报错问题
Xunwei enzhipu ITop - imx6 Development Platform
Linear algebra Chapter 3 summary of vector and vector space knowledge points (Jeff's self perception)
Recursion frog jumping steps problem
论文回顾:Playful Palette: An Interactive Parametric Color Mixer for Artists
模板参数包和函数参数包
(graph theory) connected component (template) + strongly connected component (template)
What files does a CA digital certificate contain? How to view SSL certificate information?
Select sort
[论]【DSTG】Dynamic SpatiotemporalGraph Convolutional Neural Networks for Traffic Data Imputation
What is certificate transparency CT? How to query CT logs certificate logs?
在php中字符串的概念是什么
2.8 【 weight of complete binary tree 】
Study diary: February 15, 2022
Jupyter notebook显示k线图集合
2.< tag-动态规划和0-1背包问题>lt.416. 分割等和子集 + lt.1049. 最后一块石头的重量 II
Distributed file storage system fastdfs hands on how to do it
迅为恩智浦iTOP-IMX6开发平台
公司电脑强制休眠的3种解决方案
HTA introductory basic tutorial | GUI interface of vbs script HTA concise tutorial, with complete course and interface beautification