libretiny-eu / ltchiptool

Universal, easy-to-use GUI flashing/dumping tool for BK7231, RTL8710B and RTL8720C.
MIT License
67 stars 4 forks source link

Failed to write flash #32

Open ra-kal opened 2 weeks ago

ra-kal commented 2 weeks ago

Hi, I'm trying to flash my first CB3S module with ESPhome firmware. It is a tiny switch module with installed with Matter firmware.

Chip info image

Flashing the ESPhome FW always fails:

W: Erasing failure @ 0x11000 (Erase failed - flash protected; found non-0xFF bytes @ 0x11000), retrying (attempt 0)
W: Erasing failure @ 0x11000 (Erase failed - flash protected; found non-0xFF bytes @ 0x11000), retrying (attempt 1)
W: Erasing failure @ 0x11000 (Erase failed - flash protected; found non-0xFF bytes @ 0x11000), retrying (attempt 2)
W: Erasing failure @ 0x11000 (Erase failed - flash protected; found non-0xFF bytes @ 0x11000), retrying (attempt 3)
E: An error has occurred
E: ValueError: Erase failed - flash protected; found non-0xFF bytes @ 0x11000
E: |-- File "ltchiptool\gui\work\base.py", line 24, in run
E: |-- File "ltchiptool\gui\work\flash.py", line 73, in run_impl
E: |-- File "ltchiptool\gui\work\flash.py", line 126, in _do_write
E: |-- File "ltchiptool\soc\bk72xx\flash.py", line 314, in flash_write_uf2
E: |-- File "ltchiptool\util\streams.py", line 177, in update_from
E: |-- File "bk7231tools\serial\cmd_hl_flash.py", line 185, in program_flash
E: |-- File "bk7231tools\serial\cmd_ll_flash.py", line 229, in flash_erase_block
E: |-- File "bk7231tools\serial\cmd_ll_flash.py", line 209, in do_erase_verify

I also tried flashing the Bootloader dump firmware, but it also fails:

W: Writing 4k failure @ 0x132000 (Chip CRC value F154670A does not match calculated CRC value 5AEB8451), retrying (attempt 0)
W: Writing 4k failure @ 0x132000 (Chip CRC value F154670A does not match calculated CRC value 5AEB8451), retrying (attempt 1)
W: Writing 4k failure @ 0x132000 (Chip CRC value F154670A does not match calculated CRC value 5AEB8451), retrying (attempt 2)
W: Writing 4k failure @ 0x132000 (Chip CRC value F154670A does not match calculated CRC value 5AEB8451), retrying (attempt 3)
E: An error has occurred
E: ValueError: Chip CRC value F154670A does not match calculated CRC value 5AEB8451
E: |-- File "ltchiptool\gui\work\base.py", line 24, in run
E: |-- File "ltchiptool\gui\work\flash.py", line 73, in run_impl
E: |-- File "ltchiptool\gui\work\flash.py", line 161, in _do_write
E: |-- File "ltchiptool\soc\bk72xx\flash.py", line 286, in flash_write_raw
E: |-- File "ltchiptool\util\streams.py", line 177, in update_from
E: |-- File "bk7231tools\serial\cmd_hl_flash.py", line 192, in program_flash
E: |-- File "bk7231tools\serial\cmd_ll_flash.py", line 162, in flash_write_4k
E: |-- File "bk7231tools\serial\cmd_ll_chip.py", line 75, in check_crc

What can be wrong? Do I need to somehow unprotect the FLASH? Or use some other tool to erase/flash the FW?