Skip to content

Instantly share code, notes, and snippets.

@peisenhower
Created May 1, 2015 18:47
Show Gist options
  • Save peisenhower/70b23be1bada54f1c1b1 to your computer and use it in GitHub Desktop.
Save peisenhower/70b23be1bada54f1c1b1 to your computer and use it in GitHub Desktop.
Generate a hex file of sequential bytes
from intelhex import IntelHex
import struct
h = IntelHex()
for x in range(16535):
h.puts(x, struct.pack("B", x & 0xFF))
h.tofile("sequence.hex", "hex")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment