Skip to content

Commit

Permalink
Remove redundant whole-flash CRC check
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba2k2 committed Dec 18, 2024
1 parent 7f139fb commit 1b969ea
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions bk7231tools/serial/cmd_hl_flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,6 @@ def program_flash(
block_size = len(block) if addr < end else 0
block_empty = not len(block.strip(b"\xff"))
if not block_size:
if crc_check:
self.info("Verifying CRC")
pad_size = (4096 - (io_size % 4096)) % 4096
crc = crc32(b"\xff" * pad_size, crc)
crc_chip = self.read_flash_range_crc(
start=start,
end=start + io_size + pad_size,
)
if crc != crc_chip:
raise ValueError(
f"Chip CRC value {crc_chip:X} does not match calculated CRC value {crc:X}"
)
self.info("OK!")
return
# print progress info
Expand Down

0 comments on commit 1b969ea

Please sign in to comment.