Skip to main content

LED Blink

Let's start with a simple LED blink example to familiarize ourselves with the Aotenjo One board.

Prerequisites

In this tutorial, the following hardware is used:

Aotenjo One Board

MCU: STM32G431CBU6
Version: Aotenjo One V1.4

You need this to upload the firmware to the board. You can purchase a cheap clone ST-LINK V2 under $5.

Installation

VScode with PlatformIO

You can install PlatformIO from the VSCode extension marketplace.

STM32CubeProgrammer

You need this to flash the firmware to the board.

Clone the repository

git clone https://github.com/aotenjo-xyz/one.git
cd one

The example code for the LED blink is located in the examples/led_blink directory, so run the following command if you use linux or macOS to copy the example code to the src directory:

rm src/*
cp examples/led_blink/main.cpp src/
cp examples/led_blink/platformio.ini platformio.ini

For Windows, you can copy the files manually.

Quickstart

  1. Connect the Aotenjo One board to the ST-LINK V2 programmer.

    ST-LINK V2 <-> Aotenjo One
    3.3V <---> 3.3V
    GND <---> GND
    SWDIO <---> SWDIO
    SWCLK <---> SWCLK
    RST <---> NRST
    info

    Unlink the blackpill board, you need to connect the NRST pin to the ST-LINK V2 programmer for STM32G4 series.

  2. Connect the ST-LINK V2 programmer to your computer.

  3. Open the project folder in VSCode.

  4. Click on the PlatformIO tab on the left sidebar and click on the Upload button to upload the firmware to the board.

Now you should see the LED on the Aotenjo One board blinking.