Contributed by bzhou830, organized by Ai-Thinker
[Ai-WB2] WSL Development Environment Setup — As Easy as Pie
This is a record of setting up the Ai-WB2 development environment under WSL. Overall, it is very simple — anyone can do it. The steps are also described at the link below.
Ai-Thinker-WB2: Ai-Thinker Ai-WB2 Open Source Repository (gitee.com)
1. Install Dependencies
I installed Ubuntu 20.04 in WSL, so I directly followed the SDK and installed the following dependencies:
Click to expand: sudo apt install build-essenti
sudo apt install build-essential python3 python3-pip git screenJust like this — since I had already installed these packages, it shows 0 packages to upgrade or update. 
2. Fetch the SDK
Just fetch the SDK. I used the gitee repository here — there is also an identical one on GitHub. For developers in China, gitee is much faster.
Click to expand: git clone --recursive [https:/
git clone --recursive [https://gitee.com/Ai-Thinker-Open/Ai-Thinker-WB2](https://gitee.com/Ai-Thinker-Open/Ai-Thinker-WB2)
This step also pulls the build dependencies. Since this SDK actually supports multiple platforms, there are build tools for three platforms under toolchain. If you only use one platform, you can optionally fetch just the one you need.
3. Grant Permissions
The build toolchain requires execute permissions (on Linux). So go into the Linux build tools directory and run the following commands:
Click to expand: cd toolchain/riscv/Linux/
cd toolchain/riscv/Linux/
. chmod755.sh
4. Build Test
Enter the Hello project and run a test build:

The build finishes quickly:

You can see that the bin files have been generated. Next, let's try flashing.
5. Flash Test
Flashing is actually quite similar to the M61. One thing to note is that when it prompts you to press reset, you need to manually press the RST button.


Flashing completed successfully. Open the serial port assistant and see the result.

Great, the program is running successfully.
Isn't it simple? Let's play with it together!

