当前位置:网站首页>[VCU] Detailed S19 file (S-record)
[VCU] Detailed S19 file (S-record)
2022-08-02 14:27:00 【CynalFly】
目录
1. 概述
Motorola S-record是由MotorolaA file format created,它以 ASCII十六进制Transmit binary information in text form.This file format can also be called SRECORD、SREC、S19、S28、S37.它通常用于对微控制器、EPROM and other types of programmable logic devices.
S-record格式是在1970年代中期为 Motorola 6800created by the processor.Software development tools for this processor and other embedded processors will be generatedS-recordFormat of executable code and data.Programmers will readS-recordformat and convert the data“刻录”used in embedded systemsPROM或EPROM中.
Hex is another hexadecimal format,指的是Intel-HEX,它是由Intel制定的格式.
2. S-record格式
S-record The format file consists of a series ASCII Text record composition.These records have the following structure from left to right:
type(记录类型):2个字符,一个大写的"S"(0x53),然后是一个数字0~9,Defines the type of record (S0,S1,S2,S3,S5,S7,S8,S9).
count(字节计数):2个字符,16进制数字,Represents the rest of the record(address + data + checksum)的字节数(16Binary digit pair).对于 16 Bit address field plus 1 checksum bytes,该字段的最小值为 3,最大值为 255 (0xFF).Usually recorded with 32 个数据字节.
address(地址):4或6或8个字符.by record type type 决定.对于S1和S9类型(S19),地址字段为 4 个十六进制数字(2 个字节).对于S2和S8 record(S28),地址字段为 6 个十六进制数字(3个字节),对于S3和S7 record(S37),地址字段为 8 个十六进制数字(4 个字节).The address starts with MSB 发送.The address bytes are arranged in big endian format.
data(数据):0—64字符.用来组成和说明一个代表了内存载入数据或者描述信息的16进制的值.
checksum(校验和):2个字符.这些字符当被配对并换算成16进制数据的时候形成了一个最低有效字符 节,该字符节用来表达作为补充数据,地址和数据库的字符对所代表的(字节的)补码的byte总和.即计数值、地址场和数据场的若干字符以两个字符为一对, 将它们相加求和,和的溢出部分不计,只保留最低两位字符NN,checksum =0xFF-0xNN.For a detailed checksum example,请参见示例部分.
Sending too many data bytes in one record is not recommended,Because this may increase the transfer time in case of errors.Also avoid sending only a few bytes of data per record,Because compared to the payload,The address overhead is too high.
3. S-record类型
下表描述了 10 种可能的 S 记录.S4 是保留的,当前未定义.S6 Originally reserved,But then it was redefined at some point.
记录 字段 | 记录 目的 | 地址 字段 | 数据 字段 | 记录 描述 |
---|---|---|---|---|
S0 | 标题 | 16 位 “0000” | | This record contains vendor-specific representations as a series of pairs of hexadecimal digits ASCII 文本.The data for this record is usually viewed in the format .Text data can be anything,Include a mix of the following information:文件/模块名称、版本/修订号、日期/时间、产品名称、供应商名称、PCB memory indicator on 、版权声明. |
S1 | 数据 | 16 位 地址 | | The record contains from 16 The data at the beginning of the bit address field.This record is usually used for 8 位微控制器,例如 AVR、PIC、8051、68xx、6502、80xx、Z80.The number of bytes of data this record contains is “Byte count field”减3,其中“16位地址字段”为2个字节,“校验和字段”为1个字节. |
S2 | 数据 | 24 位 地址 | | The record contains from 24 Data starting at the bit address.The number of bytes of data this record contains is “Byte count field”减4,其中“24位地址字段”为3字节,“校验和字段”为1字节. |
S3 | 数据 | 32 位 地址 | | The record contains from 32 Data starting at the bit address.This record is usually used for 32 位微控制器,例如 ARM 和 680x0.The number of bytes of data this record contains is “Byte count field”减5,其中“32位地址字段”为4个字节,“校验和字段”为1个字节. |
S4 | 预订的 | 不适用 | 不适用 | This record has been retained. |
S5 | 数数 | 16 位 计数 | | This optional record containsS1 / S2 / S3记录的 16 位计数.If the record count is less than or equal to 65,535 (0xFFFF),then use this record,否则将使用S6记录. |
S6 | 数数 | 24 位 计数 | | This optional record containsS1 / S2 / S3记录的 24 位计数.If the record count is less than or equal to 16,777,215 (0xFFFFFF),then use this record.如果小于 65,536 (0x010000),则将使用S5记录.注意:This newer record is a recent change(Not sure if it's official). |
S7 | 起始地址 (终止) | 32 位 地址 | | The record contains 32 The starting execution location of the bit address.This is used to terminate a seriesS3记录.如果 SREC The file is only used to program the storage device and the execution location is ignored,then zero address can be used. |
S8 | 起始地址 (终止) | 24 位 地址 | | The record contains 24 The starting execution location of the bit address.This is used to terminate a seriesS2记录.如果 SREC The file is only used to program the storage device and the execution location is ignored,then zero address can be used. |
S9 | 起始地址 (终止) | 16 位 地址 | | The record contains 16 The starting execution location of the bit address.This is used to terminate a seriesS1记录.如果 SREC The file is only used to program the storage device and the execution location is ignored,then zero address can be used. |
在上表中,Can see why they call these Motorola formatsS19、S28或S37.The first number in the name represents the normal data record identifier.The second number is the end-of-file record identifier.
4. S19文件示例
下图是在ECU程序编译后生成的S19文件【Project.abs.s19】Part of the content intercepted.
S0 Record:记录类型是“S0” (0x5330).地址场没有被用,用零置位(0x0000).The information in the data field is converted into a string:“E:\VMS\test\VCU\bin\Project.abs ”.此行表示程序的开始,不需烧入memory,Just tell you the relevant information about this file,实际应用中,将工程名ProjectReplace it with the project name+版本号+Format of the description text,Easy to identify files,这样在ECUVery useful to upgrade from time to time.
S1 Record:记录类型是“S1” (0x5331).地址场由2个字节地址来说明.数据场由可载入的数据组成.
S9 Record:记录类型是“S9” (0x5339).地址场由2字节的地址说明,包含了开始执行地址.没有数据场.此行表示程序的结束,不需烧入memory.
5. 校验和计算示例
S1 0F CAC0 0C0C0C0C0C0C0C007F400000 53
is decoded to show how the checksum value is calculated,如下所示:
- 累加: 0F + CA+C0 + 0C+0C+0C+0C+0C+0C+0C+00+7F+40+00+00 = 2AC(hex)
- 掩码:The least significant byte is reserved = AC(hex) = 1010 1100(bin)
- 补码:Calculate the two's complement of the least significant byte = 53(hex)
6. 参考
【1】WIKI百科.SREC
边栏推荐
- C语言待解决
- 第七单元 ORM表关系及操作
- redis delay queue
- verilog学习|《Verilog数字系统设计教程》夏宇闻 第三版思考题答案(第十一章)
- Implementation of redis distributed lock and watchdog
- 【Camera2】由Camera2 特性想到的有关MED(多场景设备互动)的场景Idea
- 什么是闭包?闭包的作用?闭包的应用?有什么缺点?
- MongoDB安装流程心得:
- Raj delivery notes - separation 第08 speak, speaking, reading and writing
- yolov5,yolov4,yolov3乱七八糟的
猜你喜欢
随机推荐
【ROS】编译软件包packages遇到进度缓慢或卡死,使用swap
Briefly write about the use and experience of PPOCRLabel
verilog学习|《Verilog数字系统设计教程》夏宇闻 第三版思考题答案(第十二章)
函数递归和动态内存初识
Error Correction Design Principle of Hamming Check Code
ABP,kendo后台接口,新增,查询
第四单元 路由层
主存储器(二)
yolov5改进(一) 添加注意力集中机制
C语言日记 3 常量
Unit 8 Middleware
Camera Hal(Hal3)层修改Preview流
安装使用——百家CMS微商城说明文档(2)
8581 线性链表逆置
什么是闭包?闭包的作用?闭包的应用?有什么缺点?
verilog学习|《Verilog数字系统设计教程》夏宇闻 第三版思考题答案(第十四章)
Verilog Learning Series
Introduction and use of Haystack
Flask request application context source code analysis
VS Code远程开发及免密配置