From 154992f860ab052304fe7758bcad644d7e7c9cd6 Mon Sep 17 00:00:00 2001 From: Carlos Pereira Atencio Date: Fri, 7 Feb 2025 16:29:18 +0000 Subject: [PATCH] Set the UF2 blocks default data to 0xFF. This is the default flash state in the majority of MCUs. --- utils/uf2conv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/uf2conv.py b/utils/uf2conv.py index c658081..cb1987a 100755 --- a/utils/uf2conv.py +++ b/utils/uf2conv.py @@ -141,9 +141,9 @@ def convert_to_uf2(file_content): return b"".join(outp) class Block: - def __init__(self, addr): + def __init__(self, addr, default_data=0xFF): self.addr = addr - self.bytes = bytearray(256) + self.bytes = bytearray([default_data] * 256) def encode(self, blockno, numblocks): global familyid