From 6d410bb8ba40fa28813ac18d84af57c649256816 Mon Sep 17 00:00:00 2001 From: dolfje Date: Sat, 30 Mar 2024 12:56:43 +0100 Subject: [PATCH] read_flash is unreliable When I tried to make a function that verified flash, it worked only 50% to have a correct page readout. Because the code only checks if the response is from the correct add, but not the correct part, it confuses the packets and add garbage in between. change sponsored by stagebees.com --- cflib/bootloader/cloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cflib/bootloader/cloader.py b/cflib/bootloader/cloader.py index 2aa56421a..53419da54 100644 --- a/cflib/bootloader/cloader.py +++ b/cflib/bootloader/cloader.py @@ -281,7 +281,7 @@ def read_flash(self, addr=0xFF, page=0x00): pk = None retry_counter = 5 while ((not pk or pk.header != 0xFF or - struct.unpack('= 0): pk = CRTPPacket() pk.set_header(0xFF, 0xFF)