Skip to content

Prerequisite

Before you start, install Git first (required to download code, https://git-scm.com/download/win) and we recommend installing VS Code as your code editor (https://code.visualstudio.com/).

Ai-Thinker Skills are AI assistance capabilities curated by Ai-Thinker. After installation, the AI can clone the SDK, configure the environment, and verify the build for you automatically — no need to run commands manually. If you have never used a terminal before, this is the recommended way to start.

1
Install Ai-Thinker Skills

Installing the Ai-M6x development skill coder-ai-m62-m61 is recommended. You can also install all Skills at once.

npx skills add Ai-Thinker-Open/skills --skill coder-ai-m62-m61
# Or install all Skills at once:
npx skills add Ai-Thinker-Open/skills
2
Describe What You Need to the AI

Start a new session in an AI coding tool that supports Skills (such as Codex or Claude Code) and let the AI set up the SDK for you, for example:

“Please use the coder-ai-m62-m61 skill to set up the Ai-M6x Windows development environment: install dependencies, clone the official Bouffalo SDK, configure the toolchain environment variables, and build the Hello World example.”

3
Wait for the AI to Finish

Based on the skill guide, the AI will automatically install dependencies, clone the SDK, configure the toolchain, and verify the build. After that, you can move on to flashing and debugging.

About the skill

coder-ai-m62-m61 is a BL616/BL618 series module development guide based on bouffalo_sdk, covering GPIO, UART, SPI, I2C, DMA, and other peripheral programming. Installation and usage: Ai-Thinker SkillsGitHub Repository

Method 2: Manual Environment Setup

Manual setup may look like many steps, but it is really just four things: install the build tools → download the SDK → build your first program → flash it to the board. Each step below explains what to do and what to do if something goes wrong — no terminal experience needed.

1
Install the Basic Tools (Git and VS Code)

You need Git to download and manage code. Open a browser, visit https://git-scm.com/download/win, download the installer, and click through the wizard (the default options are fine).

It is also recommended to install VS Code (https://code.visualstudio.com/) as your code editor — you will use its integrated terminal to build later.

2
Download the Bouffalo SDK Source Code

Press the Win key, type PowerShell and press Enter to open a terminal (or type powershell in the File Explorer address bar). Switch to a directory where you want to keep the code (for example the root of the D: drive), then clone the official Bouffalo Lab GitHub repository:

  1. cd D:/ — switch to the D: drive root; downloaded files will be stored here
  2. git clone https://github.com/bouffalolab/bouffalo_sdk.git — download the SDK (note: the Gitee mirror has not been updated for a long time, so always use the GitHub repository)

The download time depends on your network speed, so be patient. If you see fatal: unable to access, the network cannot reach GitHub — check your connection or use a proxy and try again.

cd D:/
git clone https://github.com/bouffalolab/bouffalo_sdk.git
3
Download the Windows RISC-V Cross-Compile Toolchain

The toolchain translates your code into machine code that the BL616 / BL618 chip can run. Stay in PowerShell and download the Windows toolchain from the official Bouffalo Lab GitHub repository:

  1. cd D:/ — go back to the D: drive root
  2. git clone https://github.com/bouffalolab/toolchain_gcc_t-head_windows.git — download the toolchain; when it finishes, a toolchain_gcc_t-head_windows folder is created
cd D:/
git clone https://github.com/bouffalolab/toolchain_gcc_t-head_windows.git
4
Configure the Environment Variables

The system needs to find the toolchain, make, and ninja when building. Open the Start menu, search for “Edit the system environment variables” and open it. Click “Environment Variables” at the bottom right, find Path under “System variables”, double-click it, and add the following three entries (replace D:/ with your actual location):

  1. D:\toolchain_gcc_t-head_windows\bin — the folder containing the toolchain commands
  2. D:\bouffalo_sdk\tools\make — the make build tool
  3. D:\bouffalo_sdk\tools\ninja — the ninja build tool (speeds up compilation)

Use the “Move Up” button to put the make entry at the very top so it does not conflict with another make on your system.

Environment variable Path configuration example
5
Verify the Toolchain Installation

Open a brand new PowerShell window (or restart the computer) and run these two commands:

  • make -v: should print GNU Make 4.2.1
  • riscv64-unknown-elf-gcc -v: should print gcc version 10.2.0 (Xuantie-900 ...)

If Windows says “make is not recognized as a cmdlet or command”, the environment variables have not taken effect: check the paths from the previous step, then open a new terminal (or restart) and try again.

make -v
riscv64-unknown-elf-gcc -v
6
Build the Hello World Example

Open VS Code, choose “File → Open Folder” and select D:/bouffalo_sdk. In the file tree on the left, find examples/helloworld, right-click it and choose “Open in Integrated Terminal”, then run the build command:

  • CHIP=bl616 is the chip model: the Ai-M62 (BL616) and the Ai-M61 (BL618) belong to the same series, so both use bl616, the config with the fewest pins
  • BOARD=bl616dk is the development board type

The first build downloads dependencies and generates the project, so be patient. When it finishes, the firmware is generated under build/build_out/.

make CHIP=bl616 BOARD=bl616dk
7
Flash the Firmware to the Board

Connect the development board to your computer with a USB cable, then follow these steps in order:

  1. Find the serial port: right-click “This PC” → “Manage” → “Device Manager” → “Ports (COM & LPT)”, and note the port name such as COM3
  2. Hold the BOOT button (IO2 on the Ai-M61-32S-Kit), briefly press EN/RST and release it, then release BOOT — the board is now in download mode
  3. In the VS Code terminal (in the helloworld folder), flash the firmware by replacing COM3 with your port name; flashing is done when the progress bar completes

Some USB-to-serial modules such as CH340 do not support 2M baud flashing. If flashing fails, try a lower baud rate (below 500K).

make flash CHIP=bl616 COMX=COM3
8
View the Log Output

After flashing, press the reset button on the board and the program starts running. Connect a serial tool to the port at baud rate 2000000 (2M) to see the log — MobaXterm (free) or the “Serial Port Assistant” app from the Microsoft Store both work. When you see the log printed by the program, it is running.

FAQ

"make is not recognized..." or "not recognized as an internal or external command"

The environment variables are not configured. Check that the three paths from the environment step are in the system Path, then open a new terminal (or restart).

Wrong make version

Another make may already exist on your system; use "Move Up" to put D:\bouffalo_sdk\tools\make at the very top of Path.

Where is the COM port?

Right-click "This PC" → Manage → Device Manager → Ports (COM & LPT).

Flashing fails

Make sure the board is in download mode (hold BOOT and briefly press EN/RST again); with modules such as CH340, lower the baud rate below 500K and retry.

Cloning the SDK is slow

Use a proxy if GitHub downloads are slow — do not use the Gitee mirror, which is outdated.

Terminal tips

Tab auto-completes commands in PowerShell; paste with Ctrl+V (right-click also pastes in most terminals).

Have questions?

For any other questions, visit the unified Q&A and discussion board: Ai-Thinker Discussions

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