Skip to content

Commit b8734ea

Browse files
committed
Continue with warning on BadAddress during checksum (close #54)
1 parent e31d6ce commit b8734ea

3 files changed

Lines changed: 6893 additions & 28 deletions

File tree

src/mcbootflash/flash.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,16 @@ def checksum(
271271
If checksums do not match.
272272
"""
273273
checksum1 = _get_local_checksum(chunk.data)
274-
checksum2 = _get_remote_checksum(connection, chunk.address, len(chunk.data))
274+
275+
try:
276+
checksum2 = _get_remote_checksum(connection, chunk.address, len(chunk.data))
277+
except BadAddress:
278+
_logger.warning(
279+
"Got BadAddress while checksumming, continuing anyway. "
280+
"This is probably a bug in the bootloader, not in mcbootflash. "
281+
"See https://github.com/bessman/mcbootflash/issues/54",
282+
)
283+
return
275284

276285
if checksum1 != checksum2:
277286
_logger.debug(f"Checksum mismatch: {checksum1} != {checksum2}")

0 commit comments

Comments
 (0)