Set thumb and executable attributes on padded boot2
This commit is contained in:
parent
3073cdd802
commit
095091208a
@ -45,7 +45,9 @@ odata = idata_padded + struct.pack("<L", checksum)
|
|||||||
try:
|
try:
|
||||||
with open(args.ofile, "w") as ofile:
|
with open(args.ofile, "w") as ofile:
|
||||||
ofile.write("// Padded and checksummed version of: {}\n\n".format(args.ifile))
|
ofile.write("// Padded and checksummed version of: {}\n\n".format(args.ifile))
|
||||||
ofile.write(".section .boot2, \"a\"\n\n")
|
ofile.write(".cpu cortex-m0plus\n")
|
||||||
|
ofile.write(".thumb\n\n")
|
||||||
|
ofile.write(".section .boot2, \"ax\"\n\n")
|
||||||
for offs in range(0, len(odata), 16):
|
for offs in range(0, len(odata), 16):
|
||||||
chunk = odata[offs:min(offs + 16, len(odata))]
|
chunk = odata[offs:min(offs + 16, len(odata))]
|
||||||
ofile.write(".byte {}\n".format(", ".join("0x{:02x}".format(b) for b in chunk)))
|
ofile.write(".byte {}\n".format(", ".join("0x{:02x}".format(b) for b in chunk)))
|
||||||
|
Loading…
Reference in New Issue
Block a user