Action Required! Starting November 21st, 2022, Nest Hubs opted into the Preview Program are being updated to support Matter 1.0 in anticipation of Google's general availability (GA) of Matter. All Matter devices being used with the Preview Program will need to be updated. See the Release Notes for more details.

Bouffalo Lab

Stay organized with collections Save and categorize content based on your preferences.


This example functions as a light bulb device type, with on/off capabilities. The steps were verified on a Bouffalo Lab BL602 development board.

This example uses a test Vendor ID (VID) and a Product ID (PID) of 0x8005.

A pinout diagram for the BL602 development board

Initial setup

The steps in this document were validated on Ubuntu 18.04 and 20.04.

  1. Install dependencies as specified in the connectedhomeip repository: Building Matter

  2. Install other dependencies:

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install bluez avahi-daemon bluetooth

  3. Clone and initialize the connectedhomeip repo:

    git clone
    cd connectedhomeip
    git fetch origin v1.0-branch
    git checkout FETCH_HEAD
    git submodule update --init --recursive
    source ./scripts/

Build the image and flash the board

  1. Build the lighting-app
    ./scripts/build/ --target bl602-light build
  2. Connect the board to your flashing station (MacOS, Ubuntu, Windows).
  3. Set the board to the download mode:
    1. Press and hold the BOOT button.
    2. Press the RESET button and release it.
    3. Release the BOOT button.
  4. The device should present itself as a USB serial device on your computer. You may look it up in /dev/:
    ls -la /dev/tty*
    If the device is at /dev/ttyACM0, flash the image to the board:
    cd third_party/bouffalolab/repo/tools/flash_tool
    ./bflb_iot_tool-ubuntu --chipname=BL602 --baudrate=115200  --port=/dev/ttyACM0 --pt=chips/bl602/partition/partition_cfg_4M.toml --dts=chips/bl602/device_tree/bl_factory_params_IoTKitA_40M.dts --firmware=../../../../../../out/bl602-light/chip-bl602-lighting-example.bin
    For Windows and MacOS, replace bflb_iot_tool-ubuntu with bflb_iot_tool.exe and bflb_iot_tool-macos, respectively.
  5. To wipe out an existing image on the board, append --erase to the above command.

Validate the example

  1. You can open the serial console with screen or minicom. For example, if the device is at /dev/ttyACM0:
    screen /dev/ttyACM0 115200
  2. To reset the board, press the RESET button, and you should see output like this in the terminal:
    Starting bl602 now....
    Booting BL602 Chip...
  3. To control the LED from the board after successfully commissioning it, press the BOOT button, and you should see output like this in the terminal:
    [    404197][:588238200] Short press
    [    404198][:588238200] receiving event type: 0
    [    404203][:588238200] sending event type: 0
    [    404207][:588238200] receiving event type: 0
    [    404211][:588238200] Turning light ON
    [    406211][:588238200] sending event type: 1
    [    406212][:588238200] receiving event type: 1
    [    406217][:588238200] Light ON
    [    406220][:588238200] updating on/off = 1
  4. To factory reset the board, press and hold the BOOT button for 5 seconds, and you should see output like this in the terminal:
    [     37268][:588238200] LongLong press
    [     37269][:588238200] receiving event type: 0
    [     37274][:588238200] FactoryReset! please release button!!!
    [     37279][:588238200] Toggling state to 1[     37283][:588238200] brightness: 255, mHue: 0, mSaturation: 0, red: 255, green: 255, blue: 255
    [     37292][:588238200] red level: 10000
    [     38296][:588238200] Toggling state to 0[     38297][:588238200] brightness: 0, mHue: 0, mSaturation: 0, red: 0, green: 0, blue: 0
    [     38305][:588238200] red level: 0
    [     39308][:588238200] Toggling state to 1[     39309][:588238200] brightness: 255, mHue: 0, mSaturation: 0, red: 255, green: 255, blue: 255
    [     39318][:588238200] red level: 10000
    [     42323][:588238200] [DL] Easyflash erase: f/1/n
    [     42327][:588238200] [DL] Easyflash erase: f/1/i
    [     42332][:588238200] [DL] Easyflash erase: f/1/r
    [     42335][:588238200] [DL] Easyflash erase: f/1/m
    [     42340][:588238200] [DL] Easyflash erase: f/1/o
    [     42349][:588238200] [DIS] Fabric (0x1) deleted. Calling OnFabricDeletedFromStorage
    [     42403][:588238200] [DL] Easyflash erase: f/1/k/0
    [     42462][:588238200] [DL] Easyflash erase: f/1/g
    [     42465][:588238200] [DMG] AccessControl: removing fabric 1

Next steps

When your Matter example has been successfully built, create a developer project.