Leon Anavi
IT Tips && Tricks

Internet of Things

Created: 15.01.2025 06:52 Last Modified: 15.01.2025 06:52 Views: 36
Keywords: Ai Thinker, Ai-M61-32S, BL618, RISC-V, Arduino

Arduino Sketch for BL618 RISC-V MCU and Ai Thinker Ai-M61-32S Development Board

If you are looking for RISC-V adventures, the Ai Thinker Ai-M61-32S development board is a powerful platform worth exploring. Powered by the Bouffalo Lab BL618 RISC-V microcontroller, this board offers advanced features such as Wi-Fi 6, BLE 5.3, and Thread connectivity, making it a perfect choice for cutting-edge IoT applications.

In this video and a blog post, we will walk you through the steps to get started with this board, including setting up the Arduino IDE and running a basic LED blink sketch to test the board's functionality.

Step 1: Install Arduino IDE and Set Up the Board

To get started, you will need to ensure you have Arduino IDE version 2 or newer installed on your system. If you don't have it yet, head over to the Arduino website and download the latest version.

Once you have installed the Arduino IDE, the next step is to add the custom board package for the BouffaloLab chips, which will enable compatibility with the Ai-M61-32S. Here's how:

  • Open Arduino IDE.
  • Go to File and select Preferences.
  • In the "Additional Boards Manager URLs" field, add the following URL:
    https://github.com/bouffalolab/arduino-bouffalo/releases/latest/download/package_bouffalolab_index.json
  • Click OK to save your settings.

This will allow the Arduino IDE to download the necessary board definitions for the Ai-M61-32S development board.

Step 2: Select the Ai-M61-32S Board in Arduino IDE

Now that you have added the board manager URL, it is time to select the Ai-M61-32S in the Arduino IDE:

  • Go to Tools, Board, Boards Manager.
  • Search for BouffaloLab and install the appropriate package.
  • Once installed, go to Tools > Board and select the Ai-M61-32S from the list of available boards.

Step 3: Upload a Basic LED Blink Sketch

Now that your development environment is set up, it is time to run a simple test sketch to make sure everything is working correctly. The classic LED blink sketch is a great starting point for beginners and provides a basic validation of the board's operation.

Here is the simple code for the LED blink example:

int ledPin1 = 13; // Onboard LED pin 1
int ledPin2 = 12; // Onboard LED pin 2

void setup() {
pinMode(ledPin1, OUTPUT); // Set the LED pin as an output
pinMode(ledPin2, OUTPUT); // Set the LED pin as an output
}

void loop() {
digitalWrite(ledPin1, HIGH); // Turn LED 1 on
digitalWrite(ledPin2, LOW);  // Turn LED 2 off
delay(1000);                 // Wait for 1 second

digitalWrite(ledPin1, LOW);  // Turn LED 1 off
digitalWrite(ledPin2, HIGH); // Turn LED 2 on
delay(1000);                 // Wait for 1 second
}

The slightly more sophisticated example from the video is available at GitHub.

Uploading the Sketch

  • Connect the Ai-M61-32S board to your computer using a USB-C cable.
  • Click the Upload button in the Arduino IDE.
  • After the upload is complete, the LEDs on the board should start blinking in an alternating pattern, confirming that the board is working properly.

Step 4: Explore the Source Code

For further learning, you can find the source code of Arduino core for Bouffalo Lab in GitHub. This ensures you have all the resources you need to dive deeper into more advanced projects.

Step 5: What To Do Next?

Once you have successfully completed this project, you have verified the fundamental operation of the Ai-M61-32S board. This simple LED blink sketch is just the beginning. The BL618 RISC-V microcontroller powering the board also offers advanced features such as Wi-Fi 6, BLE 5.3, and Thread, which can be leveraged for more complex IoT applications.

While the Arduino core for BouffaloLab chips is still in its early stages, as discussed in the video accompanying this post, it provides a great foundation for development. However, be aware that there may be some software limitations as the ecosystem continues to mature.

Conclusion

Getting started with the Ai-M61-32S development board is a straightforward process, especially if you follow the steps outlined here. From setting up the Arduino IDE to running your first LED blink sketch, you can quickly validate the board's basic functionality. As the Arduino core for BouffaloLab chips evolves, there will be even more possibilities to explore with this versatile RISC-V microcontroller.

Happy coding, and enjoy exploring the potential of BL618, RISC-V and Ai-M61-32S!



  Home | About | Contact | Disclaimer | Sitemap © 2009-2022 Leon Anavi. All rights reserved.