Skip to content

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

ParameterAbbreviationDescription
--help-hDisplay help information (usage instructions)
--chipnameRequired, specifies the chip model (e.g. bl602, bl702)
--interfaceCommunication interface (default uart, optional: spi, jlink, etc.)
--portSerial port (e.g. COM3, /dev/ttyUSB0)
--baudrateSerial baud rate (default 2000000, 2 Mbps recommended for flashing)
--xtalExternal crystal frequency (in MHz, default 32)

ParameterDescription
--firmwareSpecify the firmware file path (.bin file)
--boot2Specify the Boot2 bootloader file path (optional)
--ptPartition table file path (partition_table.csv)
--mfgFlash the manufacturing firmware (Manufacturing Firmware)
--mediaSpecify the Flash media type (e.g. spiflash, uart)
--romfsFlash the ROM file system (e.g. SPIFFS image)

Operation Types

ParameterDescription
--buildOnly build the image, do not flash
--eraseErase Flash (values: all, chip, or a specified address range)
--singleSingle flashing mode (does not wait for reset)
--addrSpecify the flashing start address (Hex format, e.g. 0x1000)
--startStart address for erase/operation (Hex)
--endEnd address for erase/operation (Hex)

Security Features

ParameterDescription
--keyAES encryption key (16/32-byte Hex string)
--ivAES encryption initial vector (16-byte Hex string)
--pkPublic key file path (for signature verification)
--skPrivate key file path (for firmware signing)

Other Features

ParameterDescription
--configLoad a configuration file (JSON format)
--otaOTA upgrade firmware path
--versionFirmware version number (for OTA verification)
--logEnable 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

  1. 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
  1. Erase the entire Flash:
Click to expand: bflb_iot_tool.exe --chipname=b
bash
bflb_iot_tool.exe --chipname=bl602 --port=COM3 --erase=all
  1. 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
  1. 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'
]

Released under the MIT License. Build Time 2026-09-11 14:52:23