Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:Motorola S-record

From ReverseEngineering.wiki
Format
On this wiki Facts · Code · Notes · Topics

ASCII firmware format (.srec, .s19, .s28, .s37, .mot): lines 'S' + type digit, byte count, 16/24/32-bit address, data and a ones-complement checksum; S0 header, S1/S2/S3 data, S5/S6 record count, S7/S8/S9 start address.

Overview

A record is S, a type digit, a 2-hex-digit byte count (address + data + checksum bytes), the big-endian address, the data and a checksum byte (ones-complement of the low byte of the sum of count, address and data bytes).

Record types (from the bincopy library, MIT)

S0 header (address 0, text such as the file name); S1 data with 16-bit address; S2 data with 24-bit address; S3 data with 32-bit address; S5 count of S1-S3 records (16-bit), S6 same with 24-bit count; S7 start address 32-bit, S8 24-bit, S9 16-bit. Address widths: types 0,1,5,9 two bytes; 2,6,8 three; 3,7 four.

Code & repositories

  • https://github.com/eerimoq/bincopy @ 57bb6cb1d56460fe1df3d30d317b2bfc260ae359 · license: MIT (read from LICENSE; GitHub's API was busy)
    Python library for S-record, Intel HEX, TI-TXT and binary conversion (MIT).
    Tested on: source read, not run: read · checked 2026-10-18

See also

Format:Intel HEX, Platform:ARM Cortex-M