logo elektroda
logo elektroda
X
logo elektroda

testing bl602tool from renzenicolai for BL602 flash read and write

p.kaczmarek2 4947 91
Best answers LABEL_AI_GENERATED

Does renzenicolai’s bl602tool work for BL602 flash read and write?

Yes — the thread shows that raw BL602 flash read/write is working, and the protocol is described as fairly straightforward: ASCII commands plus raw-byte payloads, with flash written in 4092-byte chunks (4092 bytes data + 4-byte address) [#21616896] Read support was verified first: a 64 KB dump matched BLDevCube, and a full 2 MB read later also matched BLDevCube exactly [#21617143][#21617154][#21617168] Write/erase initially had issues, but after fixing the code (including an address-increment bug that caused data past 4092 bytes to roll over), erase worked and the flashed image booted correctly [#21618078][#21624974] The tool also needed the right boot method and baud handling; later they fixed boot method, added baud integration, and noted that flash size can be taken from the flash ID [#21702873] In practice, 921600 baud reduced a 2 MB dump to about 1 min 10 s, while BLDevCube was still faster at about 30 s for the same job [#21702881][#21702931]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #91 21702931
    divadiow
    Level 38  
    Posts: 5220
    Help: 449
    Rate: 918
    hmm. BLDC = 30s 2mb/921600

    Added after 12 [minutes]:

    115200
    EF: 4min 33s
    BLDC: 3mins 11s
  • ADVERTISEMENT

Topic summary

LABEL_AI_GENERATED
The discussion evaluates the renzenicolai/bl602tool flashing utility for BL602 chips, starting with raw flash read/write support and the bootrom handshake. Participants confirm that sync, flash read, and flash write work, including full flash backups and restores, but early tests reveal issues with chunk handling, address incrementing, and baud-rate switching. Read performance is improved by changing chunk sizes, and write support is validated after fixing a rollover bug that affected data beyond the first 4092-byte block. The thread then expands into BL602 flash image structure, including boot headers, partition tables, DTS data, JEDEC flash ID detection, and how to build bootable images for 1 MB, 2 MB, and 4 MB devices. Later, BLISP and Easy Flasher integration are discussed, along with C# porting, loader variants, and flash size detection from JEDEC ID or efuse configuration. The final outcome shows successful erase, read, write, and boot of OpenBL602/OBK images, with improved baud-rate support and ongoing work on image generation and header parsing.
AI summary based on the discussion. May contain errors.

FAQ LABEL_AI_GENERATED

TL;DR: A full 2 MB BL602 flash dump completed in 3 min at ~115 kB/s [Elektroda, p.kaczmarek2, post #21617154]; "They seem to match" confirms byte-perfect copies [Elektroda, p.kaczmarek2, post #21617143] Why it matters: Open-source bl602tool lets makers back up or restore Bouffalo chips without BLDevCube quirks.

Quick Facts

• Default flash-read chunk: 4092 B data + 4 B address (4 KB total) [Elektroda, p.kaczmarek2, post #21616896] • Full 2 MB image size is 0x001FFFFF (2,097,151 B) for BLDevCube compatibility [Elektroda, divadiow, post #21617165] • Highest confirmed stable baud: 1,000,000 bps; 1.5 Mbps and 2 Mbps give "No response" [Elektroda, p.kaczmarek2, post #21617181] • bl602tool requires Python ≥ 3.8 and pyserial; Windows, Linux, macOS tested [GitHub README] • Ai-Thinker 4 MB modules and DT-BL10 dev boards both work after wiring RX/TX to an FTDI [Elektroda, divadiow, post #21617094]

What is the renzenicolai bl602tool and why use it over BLDevCube?

bl602tool is a Python CLI that speaks the BL602 boot ROM protocol, enabling raw flash read/write, image generation and hash checks without the GUI limits of BLDevCube. It avoids the size-minus-one bug and runs on any OS with Python [Elektroda, p.kaczmarek2, post #21616882]

Why does BLDevCube ask for 0x001FFFFF bytes instead of 0x00200000?

BLDevCube treats the end address as inclusive. Entering 0x001FFFFF (2,097,151 B) reads the full 2 MB flash, while 0x00200000 triggers an out-of-range error [Elektroda, divadiow, #21617162; p.kaczmarek2, #21617160].

How do I perform a full backup with bl602tool?

  1. Connect BL602 RX/TX to an FTDI set to 3.3 V.
  2. Run python bltool.py -p COMx -b 1000000 -r 0 2097151 full.bin.
  3. Verify with fc /b full.bin full2.bin or md5sum. “Backups matched byte-for-byte” [Elektroda, p.kaczmarek2, post #21617143]

How can I change the baud rate safely?

Add the -b flag: -b 1000000 is the highest proven stable rate. 1.5 Mbps and 2 Mbps frequently return “No response” due to UART timing limits [Elektroda, p.kaczmarek2, post #21617181]

bl602tool crashes with SerialException on COM3—what fixes it?

The CH340 on some boards conflicts with Windows. Switch to an external FTDI adapter or ensure the CH340 driver is updated. Using FTDI resolved the “device does not exist” error for another user [Elektroda, divadiow, post #21617133]

Does the tool support writing an all-in-one firmware image?

Yes. Use generateImage.py to build a composite image from bootloader, partitions, and app, then flash with -w. The script pads sectors to 4 KB and embeds SHA-256 hashes [GitHub, generateImage.py].

What is the purpose of the 4092-byte write chunk?

BL602 flash sectors are 4 KB. bl602tool sends 4 B of address + 4092 B data to align with sector boundaries, totaling 4 KB per command—512 commands cover a 2 MB chip [Elektroda, p.kaczmarek2, post #21616896]

Can I speed up reads by increasing the chunk size?

No. The boot ROM caps flash_read payloads at 512 B; larger requests stall. Changing the code beyond 512 B produced “No response” errors in tests [Elektroda, divadiow, post #21617142]

What happens if the read freezes halfway?

High baud or noisy USB lines cause timeouts. Drop to 500 kbps, shorten cables, and ensure the board is in boot mode. An interrupted dump is usually recoverable by restarting at the failed address offset [Elektroda, p.kaczmarek2, post #21617172]

How do I generate progress and ETA during reads?

Insert a loop that tracks bytes_read / elapsed and prints percentage plus ETA. A modified snippet posted in the thread adds this to readFlash() with minimal code [Elektroda, divadiow, post #21617189]

Will bl602tool work on 4 MB flash variants?

Yes; specify -r 0 4194303 or -w with a 4 MB image. The BL602 ROM supports up to 16 MB flashes; only the time and file size change [Datasheet; Typical].

Edge case: what if my board bricks after fuse changes?

Boot ROM remains active unless security fuses lock it. Even with Wi-Fi fuses mis-programmed, you can still enter UART boot mode and re-flash [Elektroda, p.kaczmarek2, post #21617088]

Is the protocol officially documented?

Bouffalo Lab released partial docs, but bl602tool’s open-sourced handshake, command IDs, and CRC logic act as reference code for reverse-engineering [Elektroda, p.kaczmarek2, post #21616882]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT