The official IoT and MCU SDK for every Bouffalo Lab RISC-V chip
Wi-Fi 4 / Wi-Fi 6 · Bluetooth LE · Zigbee · Thread · Matter
Quick Start · Documentation · Examples · Changelog · Forum · 中文
Bouffalo SDK builds firmware for all Bouffalo Lab chips from one source tree. It merges the former bl_mcu_sdk and bl_iot_sdk: one build system, one toolchain, and one peripheral driver API across the BL602, BL702, BL616 and BL618 families.
- One SDK for all chips. BL602, BL702/BL702L, BL616C/CL and BL618M/BL618DG share the same tree, build system and examples.
- One peripheral API. LHAL gives GPIO, UART, SPI, I2C, DMA, ADC, USB, crypto and other peripherals the same API on every chip, and is easy to port to other platforms.
- Wireless stacks included. Wi-Fi 4, Wi-Fi 6, Bluetooth / BLE, Zigbee, Thread and Matter.
- Common middleware ready to use. FreeRTOS, lwIP, mbedTLS, LVGL 8/9, CherryUSB, FatFS, LittleFS, OpenAMP, WAMR (WebAssembly) and more.
- Simple build. CMake with Make or Ninja, Kconfig
menuconfig, and a single GCC 14.3 toolchain for Windows, Linux and macOS. - Flashing and debugging tools. Flash Cube GUI/CLI flasher and CKLink debugging.
| Chip | CHIP |
BOARD |
Wireless |
|---|---|---|---|
| BL602 | bl602 |
bl602dk |
Wi-Fi 4, BLE, Matter |
| BL702 | bl702 |
bl702dk |
Zigbee, Thread, Matter |
| BL702L / BL704L | bl702l |
bl702ldk |
Zigbee, Thread, Matter |
| BL616C | bl616 |
bl616dk |
Wi-Fi 6, BT, BLE, Zigbee, Thread, Matter |
| BL616CL | bl616cl |
bl616cldk |
Wi-Fi 6, BT, BLE, Zigbee, Thread, Matter |
| BL618M / BL618DG | bl618dg |
bl618dgdk |
Wi-Fi 6, BT, BLE, Zigbee, Thread, Matter (not tested) |
The CHIP and BOARD values stay unchanged from earlier releases. BL618M/BL618DG is a multi-core chip; select the core with CPU_ID=ap (default) or CPU_ID=np.
Wireless support matrix
✅ supported ·
| Protocol | BL602 | BL702/BL702L/BL704L | BL616C/CL | BL618M/BL618DG |
|---|---|---|---|---|
| Wi-Fi 4 | ✅ | — | — | — |
| Wi-Fi 6 | — | — | ✅ | ✅ |
| BT | — | — | ✅ | ✅ |
| BLE | ✅ | ❌ | ✅ | ✅ |
| Zigbee | — | ✅ | ✅ | ✅ |
| Thread | — | ✅ | ✅ | ✅ |
| Matter | ✅ | ✅ | ✅ |
LHAL peripheral support matrix
✅ supported ·
| Peripheral | BL602 | BL702/BL702L/BL704L | BL616C/CL | BL618M/BL618DG |
|---|---|---|---|---|
| ADC | ✅ | ✅ | ✅ | |
| CAM | — | ✅ | ✅ | ✅ |
| CKS | ✅ | ✅ | ✅ | |
| CSI | — | — | — | — |
| DAC | ✅ | ✅ | ✅ | |
| DMA | ✅ | ✅ | ✅ | |
| EFUSE | ❌ | ✅ | ✅ | ✅ |
| EMAC | — | ✅ | ✅ | ✅ |
| FLASH | ✅ | ✅ | ✅ | ✅ |
| GPIO | ✅ | ✅ | ✅ | |
| I2C | ✅ | ✅ | ✅ | |
| I2S | ✅ | ✅ | ||
| IR | ✅ | ✅ | ✅ | |
| MJPEG | ❌ | ❌ | ✅ | ✅ |
| PWM_v1 | ✅ | — | — | |
| PWM_v2 | — | — | ✅ | ✅ |
| RTC | ✅ | ✅ | ✅ | |
| SEC_AES | ✅ | ✅ | ✅ | |
| SEC_SHA | ✅ | ✅ | ✅ | |
| SEC_TRNG | ✅ | ✅ | ✅ | |
| SEC_PKA | ✅ | ✅ | ✅ | |
| SPI | ✅ | ✅ | ✅ | |
| TIMER | ✅ | ✅ | ✅ | |
| UART | ✅ | ✅ | ✅ | ✅ |
| USB_v1 | — | ✅ | — | — |
| USB_v2 | — | — | ✅ | ✅ |
| WDG | ✅ | ✅ | ✅ |
git clone https://github.com/bouffalolab/bouffalo_sdk.git
# Mirror for users in China:
# git clone https://gitee.com/bouffalolab/bouffalo_sdk.gitNote
Since v2.3.37 the repository uses a compact Git history so that clones and pulls are faster. To join it with the full history up to v2.3.36, run:
git replace -f --graft 'v2.3.37-history-base^{}' 'v2.3.36^{}'Download the GCC 14.3 toolchain for your OS (Windows, Linux x86_64 / arm64, macOS arm64) from GitHub or Gitee, then add its bin directory to PATH. You also need make or ninja; Windows builds of both are included in tools/make and tools/ninja.
riscv64-unknown-elf-gcc --version # check that the toolchain is on PATHThe full guide is in Environment Setup.
Every example directory contains a main.c and a Makefile. Pick CHIP and BOARD from Supported Chips:
cd examples/helloworld
make CHIP=bl616 BOARD=bl616dk # or: make ninja CHIP=bl616 BOARD=bl616dkFor the multi-core BL618M/BL618DG, build each core separately:
cd examples/bl618dg_dualcore
make CHIP=bl618dg BOARD=bl618dgdk CPU_ID=ap # AP core
make CHIP=bl618dg BOARD=bl618dgdk CPU_ID=np # NP coreImportant
Always pass CHIP and BOARD. Without them the build defaults to CHIP=bl616 BOARD=bl616dk and does not warn you.
Other useful targets:
make menuconfig CHIP=bl616 BOARD=bl616dk # change Kconfig options
make clean # remove the build directorymake flash CHIP=bl616 COMX=/dev/ttyUSB0 # Windows: COMX=COM5On Linux, add your user to the dialout group to access serial ports without sudo, then log out and back in:
sudo usermod -aG dialout $USERMaximum flashing baud rate by USB-to-serial chip
When flashing over a serial port rather than USB, keep the baud rate within what your USB-to-serial chip supports.
| USB-to-serial chip | Max baud rate |
|---|---|
| CH340 | 500K |
| CP2102 | 2M |
| FT232 | 2M |
| BL702 | 8M |
| BL616 | 10M |
For the graphical flasher, see the Flash Cube User Guide.
Debugging is supported with CKLink. See the Debug Guide; CKLink firmware is in tools/cklink_firmware.
bouffalo_sdk/
├── bsp/
│ ├── board/ # Board init: clock, pinmux, memory heap, console
│ └── common/ # Common board drivers (LCD, image sensors, ...)
├── cmake/ # CMake build scripts
├── components/ # Middleware, wireless stacks, RTOS, file systems, graphics
├── docs/ # Quick start, API reference and demo docs
├── drivers/
│ ├── lhal/ # Common peripheral drivers for all chips
│ ├── soc/ # Chip-specific drivers
│ ├── rfparam/ # RF parameters
│ └── sys/ # System drivers
├── examples/ # Official examples
├── tests/ # Unit tests
└── tools/ # Flashing, debugging and build tools
| Resource | Link |
|---|---|
| SDK documentation: API reference, peripheral demos (Chinese) | bl-mcu-sdk.readthedocs.io |
| Chip reference manuals and datasheets | bouffalolab/bl_docs |
| Supported LCD panels | bsp/common/display |
| Supported camera sensors | bsp/common/image_sensor |
| Release notes | CHANGELOG.md |
| Developer forum | bbs.bouffalolab.com |
Software bill of materials (SBOM)
Bug reports and pull requests are welcome. Please search the existing issues before you open a new one, and include the chip, board, SDK version and build log in your report. For usage questions, the forum usually gets a faster answer.
Bouffalo SDK is released under the Apache License 2.0. Third-party components keep their own licenses; see Third-party Components.
