Contributed by Shenye, organized by Ai-Thinker
Bouffalo Lab Smart IoT Tool (Flash Programming)
The following is a detailed translation and explanation of all parameters of bflb_iot_tool.exe:
Basic Parameters
| Parameter | Abbreviation | Description |
|---|---|---|
| --help | -h | Display help information (usage instructions) |
| --chipname | Required, specifies the chip model (e.g. bl602, bl702) | |
| --interface | Communication interface (default uart, optional: spi, jlink, etc.) | |
| --port | Serial port (e.g. COM3, /dev/ttyUSB0) | |
| --baudrate | Serial baud rate (default 2000000, 2 Mbps recommended for flashing) | |
| --xtal | External crystal frequency (in MHz, default 32) |
Firmware Related
| Parameter | Description |
|---|---|
| --firmware | Specify the firmware file path (.bin file) |
| --boot2 | Specify the Boot2 bootloader file path (optional) |
| --pt | Partition table file path (partition_table.csv) |
| --mfg | Flash the manufacturing firmware (Manufacturing Firmware) |
| --media | Specify the Flash media type (e.g. spiflash, uart) |
| --romfs | Flash the ROM file system (e.g. SPIFFS image) |
Operation Types
| Parameter | Description |
|---|---|
| --build | Only build the image, do not flash |
| --erase | Erase Flash (values: all, chip, or a specified address range) |
| --single | Single flashing mode (does not wait for reset) |
| --addr | Specify the flashing start address (Hex format, e.g. 0x1000) |
| --start | Start address for erase/operation (Hex) |
| --end | End address for erase/operation (Hex) |
Security Features
| Parameter | Description |
|---|---|
| --key | AES encryption key (16/32-byte Hex string) |
| --iv | AES encryption initial vector (16-byte Hex string) |
| --pk | Public key file path (for signature verification) |
| --sk | Private key file path (for firmware signing) |
Other Features
| Parameter | Description |
|---|---|
| --config | Load a configuration file (JSON format) |
| --ota | OTA upgrade firmware path |
| --version | Firmware version number (for OTA verification) |
| --log | Enable verbose log output |
Error Explanation
If the following message appears at runtime: bflb_iot_tool.exe: error: the following arguments are required: --chipname It means the chip model must be specified (e.g. --chipname=bl602).
Example Commands
- Flash firmware:
Click to expand: bflb_iot_tool.exe --chipname=b
bash
bflb_iot_tool.exe --chipname=bl602 --port=COM3 --baudrate=2000000 --firmware=app.bin- Erase the entire Flash:
Click to expand: bflb_iot_tool.exe --chipname=b
bash
bflb_iot_tool.exe --chipname=bl602 --port=COM3 --erase=all- Encrypted flashing:
Click to expand: bflb_iot_tool.exe --chipname=b
bash
bflb_iot_tool.exe --chipname=bl602 --firmware=app.bin --key=0123456789ABCDEF --iv=1234567890ABCDEF- SDK flashing command:
Click to expand: [
bash
[
'Y:\\mcu\\bl602\\Ai-Thinker-WB2\\tools\\flash_tool\\bflb_iot_tool.exe'
,
'--chipname=BL602'
,
'--baudrate=921600'
,
'--port=com1'
,
'--pt=Y:/mcu/bl602/Ai-Thinker-WB2/tools/flash_tool/chips/bl602/partition/partition_cfg_2M.toml'
,
'--dts=Y:/mcu/bl602/Ai-Thinker-WB2/tools/flash_tool/chips/bl602/device_tree/04-bl_factory_params_IoTKitA_40M-20220625.dts'
,
'--boot2=Y:/mcu/bl602/Ai-Thinker-WB2/tools/flash_tool/chips/bl602/builtin_imgs/boot2_isp_bl602_v6.5.1/boot2_iap_release.bin'
,
'--firmware=Y:/mcu/bl602/Ai-Thinker-WB2/applications/get-started/blink/build_out/blink.bin'
]
