From 733b49676ca6abcc987b7d3714ff528637a1f3db Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Mon, 16 Sep 2024 11:33:37 -0500 Subject: [PATCH] allow for saving the board dump in .uf2 format Signed-off-by: Brian S. Stephan --- gp2040ce_bintools/builder.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gp2040ce_bintools/builder.py b/gp2040ce_bintools/builder.py index 2cfeb40..c9e049f 100644 --- a/gp2040ce_bintools/builder.py +++ b/gp2040ce_bintools/builder.py @@ -338,7 +338,11 @@ def dump_gp2040ce(): args, _ = parser.parse_known_args() content, _, _ = get_gp2040ce_from_usb() with open(args.binary_filename, 'wb') as out_file: - out_file.write(content) + if args.binary_filename[-4:] == '.uf2': + # we must pad to storage start in order for the UF2 write addresses to make sense + out_file.write(storage.convert_binary_to_uf2([(0, content)])) + else: + out_file.write(content) def summarize_gp2040ce():