Zt: Commonly Used single-chip microcomputer output format-Motorola S-records (S19 files)

Source: Internet
Author: User
Motorola S-records hexadecimal file format is a common embedded format except intel hex. below is its format:
+ ------------------- // -------------------- // ----------------------- +
| Type (hex1) | count (hex 1) | address | data | checksum (from count to checksum, total 0xFF) |
+ ------------------- // -------------------- // ----------------------- +
S0: Id record. The address field length is 2 bytes and is filled with 0000. The data area records information such as the module name and version.
S1: data record. The address field length is 2 bytes, and the data area is the data content.
S2: data record. The address field is 3 bytes in length and the data area is the data content.
S3: data record. The address field length is 4 bytes, and the data area is the data content.
S5: the number of statistical records (S1, S2, S3) with a length of 2 bytes. The data area is empty.
S7: operation record. The address field is 4 bytes long. The content is the address of the program startup and the data field is empty.
S8: running record. The address field is 3 bytes in length. The content is the address of the program startup and the data field is empty.
S9: The running record. The address field consists of 2 bytes. The content is the address of the program startup and the data field is empty.
The following is an example:
Bytes
S2080108fffffffa
S30800020000000000F5
S5030002FA
S9030000FC line 1: Nothing, just start.
Row 2: The address 0x10000 has four 0xFF
Row 3: Address 0x20000 has 3 0x00
Row 4: indicates that two data records exist.
The fifth line: The program runs the checksum algorithm from the 0x0000 address, which is not the same as intel hex,
Checksum = 0xFF-(total of all bytes starting from the count segment ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.