Files
lab-rv32i-freertos-sw-timer/vendor/Hazard3/scripts/mkflashexec
T
2026-07-21 19:14:20 +02:00

15 lines
356 B
Python
Executable File

#!/usr/bin/env python3
import argparse
import struct
parser = argparse.ArgumentParser()
parser.add_argument("ifile")
parser.add_argument("ofile")
args = parser.parse_args()
data = open(args.ifile, "rb").read()
with open(args.ofile, "wb") as ofile:
ofile.write("RISCBoy".encode() + bytes(1))
ofile.write(struct.pack("<L", len(data)))
ofile.write(data)