optionally concatenate files in .uf2 format

This commit is contained in:
Brian S. Stephan 2024-01-06 21:02:27 -06:00
parent d6857d5da1
commit 7bd303dd06
Signed by: bss
GPG Key ID: 3DE06D3180895FCB
1 changed files with 4 additions and 1 deletions

View File

@ -106,7 +106,10 @@ def concatenate_firmware_and_storage_files(firmware_filename: str,
if combined_filename:
with open(combined_filename, 'wb') as combined:
combined.write(new_binary)
if combined_filename[-4:] == '.uf2':
combined.write(convert_binary_to_uf2(new_binary))
else:
combined.write(new_binary)
if usb:
endpoint_out, endpoint_in = get_bootsel_endpoints()
write(endpoint_out, endpoint_in, GP2040CE_START_ADDRESS, bytes(new_binary))