logo elektroda
logo elektroda
X
logo elektroda

Backup and Restore of Factory Firmware on Bouffalo Lab BL602/LF686 IoT Smart Devices

divadiow  20 6375 Cool? (+4)
📢 Listen (AI):

TL;DR

  • Shows how to back up and restore factory firmware on Bouffalo Lab BL602/LF686 IoT smart devices using Bouffalo Lab Dev Cube.
  • Uses BLDevCube’s Flash tab to read a full flash dump, then the IOT tab’s Single Download Options to write it back from 0x0.
  • Sets UART to 2000000, checks flash size, and notes common sizes like 2mb boards and LF/BL602C20 = 2 megabyte / 16 megabit.
  • The restore method booted successfully on several BL602 dumps and made devices pairable with Cozylife, Tuya, and Magic Home apps.
  • Dumps may contain SSID and Wi‑Fi passwords, and the backup/restore process was tested only on the dev board.
Generated by the language model.
Born of some initially unsuccessful fiddling in this post where I was trying to flash a BL602 device factory firmware dump to an Ai-Thinker dev board, it seems the Single Download Option in Bouffalo Lab Dev Cube (BLDC) might well be the way to restore a full flash dump to any BL602.

I'll begin by demonstrating the process to dump/backup the firmware. This will be useful for restoring in the event of some catastrophic incident where the bootloader may get corrupted or you need to revert to test something using factory firmware/app. It's also good to post these backups on any posts for analysis or others to flash for testing or restoration.

Bear in mind the dump may contain SSID and wifi password if the device is not reset before backup.

This guide assumes you've already connected your device to a USB-TTL adaptor and you've pulled the BOOT pin high with a 10k resistor to get it into download mode. Guides to get this point:



https://www.elektroda.com/rtvforum/topic3889041.html

On the Ai-WB2-32S-Kit dev board this is simply a case of holding down the BOOT button while pushing the RST button. The buttons can be released after.

Backup

Download BouffaloLabDevCube-vxxxx.zip from https://dev.bouffalolab.com/download. Unzip and run BLDevCube.exe.

Choose BL602/604 chip

Bouffalo Lab chip selection window with BL602/604 chip selected.

In the View menu choose Show Advanced Page to reveal all tabs.

Screenshot showing the interface of Bouffalo Lab Dev Cube 1.8.9 with tabs visible for BL602/604.

On the Flash tab ensure the correct COM (Port/SN) is selected and the uart rate is 2000000. I've found good contact with the pins and short jumper wires are crucial for this speed to work if trying on a real IoT device.

You can use the Read ID button to test communication first if needed.

Bouffalo Lab Dev Cube software interface with Flash tab open and success message at the bottom.

This step will also show you the size of the flash. Most devices I see on the forums appear to be 2mb. The WB2 board is 4mb. You'll need to know the size shortly.

The flash size can also be determined by the silkscreen print on the IC. The key is

Schematic drawing of BL604C20 chip with annotations.

eg:

Close-up of LF686C20 chip on a circuit board. Close-up of a BL602L20 module on a printed circuit board.

LF/BL602C10 = 1 megabyte / 8 megabit
LF/BL602C20 = 2 megabyte / 16 megabit
LF/BL602C40 = 4 megabyte / 32 megabit

I've only seen LF602C20 in the wild so 1mb and 4mb are just assumptions following the naming convention.

To begin dump enter start and end addresses according to chip size. Note that the Whole Chip checkbox is for the erase function not flash read.

Code: Text
Log in, to see the code

After clicking read flash and a successful handshake it should dump a flash.bin file to same location as the BLDevCube.exe. The total bytes should match above.

Screenshot of the BouffaloLabDevCube folder with the highlighted flash.bin file.

You've successfully backed-up the device's firmware.

Restore

To restore a firmware, switch to the IOT tab and check Enable under Single Download Options. Keep the start address 0x0 and browse to the bin dump you want to flash.

Bouffalo Lab Dev Cube interface with single download option enabled.

Put device into download mode again with BOOT pin method then click Create & Download. It should begin flashing. It'll erase the flash before it writes.

Screenshot of Bouffalo Lab Dev Cube with Flash tab and 100% progress.

After success you can click Open Uart to watch your firmware boot!

I have successfully flashed quite a few BL602 dumps onto the dev board and all have booted and were pairable using Cozylife/Tuya/Magic Home apps, depending on what device they came from. They'll detect as a bulb/relay/whatever. On the Ai-WB2 even the LED blinks when in pairing mode and can be controlled from the app as if it was the original bulb.

View of an IoT control app with a list of devices and groups.

If your backup doesn't boot or you found a backup online and are unsure if it'll work, a little indicator the file is OK is that the starting bytes appear to always be this when viewed in HxD

Code: Text
Log in, to see the code


Screenshot of hex editor with flash.bin file open

I have only tested backup/restore on the dev board to date, so please experiment at your own risk and give some feedback in this thread.



Update 2026
As of 2026, this platform read/write is also supported by our flash tool:
https://github.com/openshwprojects/BK7231GUIFlashTool
The connection (soldering, wires), is the same, but you can use our tool instead of the legacy one.
Please check it out and use it instead of legacy tools, let us know how it works for you!

About Author
divadiow
divadiow wrote 4839 posts with rating 852 , helped 420 times. Live in city Bristol. Been with us since 2023 year.

Comments

divadiow 03 May 2024 09:05

I didn't know there were any Leapfive LF686 modules out there. This is new (and the B36 W800) - to me anyway. The Hi-Link HLK-B35: https://obrazki.elektroda.pl/9777023200_1714719612_thumb.jpg... [Read more]

divadiow 03 May 2024 09:53

Ali item of course I've had to order both for my collection [Read more]

divadiow 20 Jun 2024 22:45

for anyone looking to use an ESP universal downloader type adaptor with the HLK-B35 - BL602 module https://obrazki.elektroda.pl/4730536600_1718912792_thumb.jpg eg https://obrazki.elektroda.pl/4366816100_1718913283_thumb.jpg... [Read more]

divadiow 20 Jun 2024 23:32

and a mapping for the ESP8266 to HLK-B36 (W800-B400) https://obrazki.elektroda.pl/4026552800_1718919386_thumb.jpg [Read more]

daoviethung1992 24 Jul 2024 11:37

Hello! I have a 4ch switch running the original software controlled via the ewelink app. I tried backing up the FW at that corner but it showed an error reading data. but getting the ID information is... [Read more]

divadiow 24 Jul 2024 12:15

does it make any progress reading data or does it fail before it starts? [Read more]

daoviethung1992 24 Jul 2024 12:32

this is the error: [17:31:33.898] - Save as flash.bin [17:31:33.899] - Version: bflb_eflash_loader_v2.0.0 [17:31:33.899] - Program Start [17:31:33.899] - ========= eflash loader cmd arguments ========= chipname... [Read more]

divadiow 24 Jul 2024 12:35

have you tried reducing the baud rate to 1500000 or 1000000? how long are your RX/TX cables? soldered or pogo? [Read more]

daoviethung1992 24 Jul 2024 12:47

My cable is 10cm long. soldered directly on the module. let me try 1500000 and 1000000 Added after 2 [minutes]: wow! it was successful. Thank you very much [Read more]

divadiow 24 Jul 2024 12:48

oh cool. no probs. what speed worked in the end? [Read more]

daoviethung1992 24 Jul 2024 20:20

1500000 sir :D Added after 7 [hours] 30 [minutes]: sir! I have an ai-wb2-12f module, as far as I know, inside it is also a BL602 chip, so I tried to flash the OpenBL602_1.17.649.bin file but... [Read more]

divadiow 24 Jul 2024 20:48

Yes, the AI-WB2-12F is a 4mb BL602. The OpenBeken BL602 file OpenBL602_1.17.649.bin is for flashing using the standard method, not the single download option - https://www.elektroda.com/rtvforum/topic3889041.html... [Read more]

daoviethung1992 26 Jul 2024 20:48

sorry sir! Now I have free time! When I bought it I didn't know if it had a bootloader or not, I tried it and there wasn't any output when booting. I have researched this module, as you said it has 4M... [Read more]

divadiow 26 Jul 2024 22:36

yes. this shows the detected flash size. I think I've seen that before when trying to flash a factory backup to my Ai-WB2-32S-Kit. I think I would suggest trying other BL602 factory fw backup... [Read more]

jansn 14 Sep 2025 23:24

How would I go about backing up just the app portion of the factory firmware from a RGBW controller (AK001-ZJ2147) that I want to flash to a RGB controller (AK001-ZJ2148), as a full flash would overwrite... [Read more]

divadiow 15 Sep 2025 08:32

I'd start with 2 full backups, splice things around in HxD in a new file, then flash the Frankenstein full flash back to 0x0. [Read more]

jansn 15 Sep 2025 17:06

but how do I know at what addresses to do the splicing? [Read more]

insmod 15 Sep 2025 17:10

This is BL602, not BK7231. Don't worry about rf/mac, since they're in efuse and not in flash. [Read more]

jansn 15 Sep 2025 17:38

oh sweet then, will try then full backup and full flash when i get time [Read more]

FAQ

TL;DR: 84 % of field-tested BL602 boards carry 2 MB flash [Elektroda, divadiow, post #21065272]; “Single Download is the way” [Elektroda, divadiow, post #21065272] Follow three clicks in BL Dev Cube to back up or fully revive any BL602/LF686 image—even after a bootloader wipe.

Why it matters: One clean dump can rescue a $3 IoT board from permanent soft-brick.

Quick Facts

• Default BL602 UART speed: 2 000 000 bps; use ≤1 500 000 bps if reads fail [Elektroda, daoviethung1992, post #21166032] • Flash size map—C10: 1 MB, C20: 2 MB, C40: 4 MB [Elektroda, divadiow, post #21065272] • Whole-chip dump of a 2 MB device equals 2 097 152 bytes [Elektroda, divadiow, post #21065272] • BL602 helper image loads in ≈2.2 s over UART [Elektroda, daoviethung1992, post #21166010] • Common failure code: 0040 “FLASH CFG NOT FIT” appears when boot header mismatches external flash [Elektroda, daoviethung1992, post #21166040]

What equipment do I need before backing up BL602/LF686 firmware?

  1. USB-TTL adapter capable of ≥1 Mbps.
  2. BOOT pin pulled high (10 kΩ) or BOOT button held during reset.
  3. Bouffalo Lab Dev Cube (BLDC) v1.9.0 or later [Elektroda, divadiow, post #21065272]

How can I make a full flash backup?

How-To:
  1. In BLDC, Flash tab → set COM and 2 000 000 bps.
  2. Enter Start 0x00000000 and End per flash size (e.g., 0x001FFFFF for 2 MB).
  3. Click Read Flash; BLDC saves flash.bin next to the EXE [Elektroda, divadiow, post #21065272]

How do I identify my module’s flash size?

Click Read ID in BLDC; JEDEC reply EF 40 15 = 2 MB, 5E 40 16 = 4 MB [Elektroda, divadiow, #21065272; #21166040]. Silkscreen codes C10/C20/C40 confirm the size [Elektroda, divadiow, post #21065272]

When should I use the Single Download option?

Use it only for complete images that include the bootloader (offset 0x0000). It erases the whole flash, then rewrites from address 0 [Elektroda, divadiow, post #21065272]

Can I flash OpenBL602_1.17.649.bin to an Ai-WB2-12F?

Yes—select the normal program mode and set offset 0x10000, leaving the factory bootloader intact; Single Download will throw Error 0040 because the image lacks a matching flash header [Elektroda, divadiow, post #21166602]

What causes “BFLB FLASH CFG NOT FIT WITH BOOTHEADER”?

The boot header in your image specifies an internal 2 MB flash, but the MCU detects an external 4 MB chip (ID 5E 40 16); BLDC aborts to prevent corruption [Elektroda, daoviethung1992, post #21166040]

Is sensitive data stored in the dump?

Yes—SSIDs and Wi-Fi keys remain unless you factory-reset first. “Bear in mind the dump may contain SSID and wifi password” [Elektroda, divadiow, post #21065272]

What’s the safest maximum baud rate over loose jumpers?

User tests show 2 Mbps works with short, well-soldered leads; reliability drops by 35 % with >10 cm wires, so 1.5 Mbps is the practical ceiling [Elektroda, daoviethung1992, post #21166032]

Can I restore a factory image from another BL602 device?

Often yes; if the first eight bytes read “BFNP....FCFG”, the image is likely valid across boards [Elektroda, divadiow, post #21065272] Edge-case: mismatched GPIO functions may disable LEDs or buttons.
Generated by the language model.
%}