Contributed by 大锤子, organized by Ai-Thinker
High-Performance WiFi + BLE Dual-Mode Ai-WB2-32S-Kit Unboxing and LED Blink
Preface
First of all, the board still has the same black PCB, very high-end and elegant. The materials are also solid. The USB-to-serial tool directly supports flashing, saving you from buying a separate download tool. The silkscreen on the board is very clear, and there are user interaction interfaces: an RGB LED, a reset button, and a Boot button. For the unboxing test, there's no need to set up a separate test circuit. It's much better than the GDXXX dev board I applied for from the other vendor.
Every advantage has its disadvantage. Both boards are based on RISC-V WiFi + Bluetooth modules. In terms of board hardware design, the Ai-WB2-32S-Kit wins. But when it comes to environment setup, the other vendor's is more user-friendly.
Environment setup should also be part of evaluating whether a module is easy to use. After all, without a development environment, the module is unusable, and step one trips up quite a few people. Although there are many tutorials on the forum and they're quite detailed, some just don't fit your setup, so you have to hunt around for solutions.
I received the board nearly a week ago. From the moment I learned my application was approved, I started preparing the environment. Most people use Windows + Eclipse, or Linux on a VM, or Linux on WSL. I also have a Windows PC, but I'm not used to it, so I focused on getting it working on my Mac.
Enough talk. This article first shares the environment setup and unboxing (LED blink). In later posts, I'll try the advanced features like WiFi and Bluetooth.
Environment Setup
Last year I also got a dev board from Ai-Thinker, and I set up the environment on Windows back then. I also tried setting up the environment on a Mac, but it was a bit troublesome. Here's some good news: this time, setting up the environment on a Mac seems to only need the official SDK. The toolchain subdirectory under the SDK directory contains the required compilation tools. Other tools like make and ninja can be installed directly with brew.
Getting the Official SDK
Pick a directory to store the SDK, then use git to pull the SDK from the git repository, as shown:

A Quick Look at the SDK Directory
Open the SDK directory with VSCode, and you can see the directory structure below — it's quite clear:
applications: official demos;
components: some components;
toolchain: the compilation toolchain;
tools: flashing tools
It's recommended to read the README carefully;

Among them, the toolchain directory contains compilation tools for various operating systems, for example:

There are also tools for flashing:

Build Failure and Solution
It looks like the environment is set up successfully. Let's try compiling an LED blink demo:

As expected, it failed as shown in the figure above. The reason is permission denied.
There's a README file in the SDK root directory that mentions you need to modify the file access permissions.
Just modify it as described. After the modification:
Obviously, the build succeeded. And it prompts that you can flash the program with the make flash command.
Let's try it right away.
Flash Failure and Solution

Unfortunately, it failed as shown in the figure above. And you can see from the figure that the flashing tool seems wrong, and the serial port is wrong too.
This is something that has to be said: if you claim to support it, you should really support it. Still, finding bugs is part of what a review is about, and that's fair enough. After continuous attempts and suggestions from the big guys in the group, and after reading through the source code, I found that a few places need to be modified. These places are all in the project.mk file under the SDK directory:

第18行:FLASH_TOOL_TYPE:= ./bflb_iot_tool-macosSimilarly, line 25:
FLASH_TOOL_TYPE:=./bflb_iot_tool-macosLine 589, in the flash target, specify the actual serial port directly for the --port parameter. On a Mac, you can check with ls /dev/tty*
Flash again after the modification:

As shown in the figure above, when we see the prompt to press the reset button, it means success. After pressing the reset button:

Video Demo:
The video upload failed......

To be continued......
This board is quite fun, focusing on WiFi and Bluetooth, and the peripherals are also fun to play with. I'll share my study notes separately later.

