Skip to content

Commit

Permalink
- Synchronize changes from gekkoboot.
Browse files Browse the repository at this point in the history
Co-authored-by: novenary <[email protected]>
  • Loading branch information
Extrems and 9ary committed Aug 12, 2024
1 parent 9aa7367 commit 7b858ea
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions buildtools/dol2ipl.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def pack_uf2(data, base_address):
data = data[chunk_size:]

ret += struct.pack(
"< 8I 476B I",
"< 8I 476s I",
0x0A324655, # Magic 1 "UF2\n"
0x9E5D5157, # Magic 2
0x00002000, # Flags (family ID present)
Expand All @@ -104,7 +104,7 @@ def pack_uf2(data, base_address):
seq,
total_chunks,
0xE48BFF56, # Board family: Raspberry Pi RP2040
*chunk.ljust(476, b"\x00"),
chunk,
0x0AB16F30, # Final magic
)

Expand Down Expand Up @@ -146,6 +146,7 @@ def main():
return -1

date = "" if len(sys.argv) < 4 else sys.argv[3]
assert date <= "2004/02/01"

header_size = 32
header = struct.pack(
Expand Down Expand Up @@ -173,8 +174,8 @@ def main():

header_size = 32
header = struct.pack(
"> 8B I 20x",
*b"IPLBOOT ",
"> 8s I 20x",
b"IPLBOOT ",
len(img) + header_size,
)
assert len(header) == header_size
Expand Down

0 comments on commit 7b858ea

Please sign in to comment.