diff --git a/scripts/uf2_append_boot_signature.py b/scripts/uf2_append_boot_signature.py new file mode 100755 index 0000000..4c2c797 --- /dev/null +++ b/scripts/uf2_append_boot_signature.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 +# Add boot signature (one page of zeros) at gived address. +# +# This file may be distributed under the terms of the GNU GPLv3 license. +import sys, argparse, struct + +def renumerate(content): + result = bytearray() + total = len(content) // 512 + for current in range(total): + block = content[current * 512 : (current + 1) * 512] + result.extend(block[ : 20]) + result.extend(struct.pack("