SREC (file format)
From Wikipedia, the free encyclopedia
Motorola S-records (SREC) are a form of simple ASCII encoding for binary data. This format is commonly used for firmware uploads to GPSes, industrial robots, and other kinds of microcontroller-driven hardware. It has several convenient properties, including inspectability, easy editing with any text editor, and checksumming for verification of transmission across noisy serial lines.
It consists in a series of hexadecimal data lines, following this structure:
- Start code, one character, an ASCII letter 'S'.
- Record type, one digit, 0 to 9, defining the type of the data field.
- Byte count, two hex digits, a number of bytes (hex digit pairs) in the data and checksum fields.
- Address, four, six or eight hex digits, the memory position for the data. This address is big endian.
- Data, a sequence of n bytes of the data themselves. 2n hex digits.
- Checksum, two hex digits - the least significant byte sum of the values of all fields, inverted.
It is used (among others) by Altera tools to describe executable binary code for embedded processors.
A similar encoding, with slightly different ASCII formatting, termed Intel_HEX is used with Intel processors.