CAN Bus
In this tutorial, we will explore how to prepare the Aotenjo One board for CAN Bus communication and run closed loop angle control.
Prerequisites
In this tutorial, the following hardware is used:
- Aotenjo One Board
MCU: STM32G431CBU6
Version: Aotenjo One V1.4 - Diametrically magnetized disc magnet (included with Aotenjo One)
- ST-LINK V2 Clone
- BlackPill STM32 Board
- BE4108 75T Gimbal Motor
- Power Supply (12V)
- Soldering Kit
You need a ST-LINK V2 Clone to upload the firmware to the board. You can purchase a cheap clone ST-LINK V2 under $5.
CAN Bus Connection
Aotenjo One communicates via CAN Bus, allowing you to control multiple Aotenjo One boards using just four wires: CAN_H, CAN_L, VCC, and GND.
Keep in mind that a CAN Bus requires termination resistors at both ends of the network to prevent signal reflections.
In the setup shown above, the main CAN hub — Aotenjo Master — includes a built-in termination resistor. Therefore, you only need to enable termination on the last Aotenjo One board in the chain (e.g., the M0 unit) by soldering the termination jumper located on the top side of the board, as shown in the image below.
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
Quickstart
-
Place the magnet on the motor shaft.

-
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 <---> NRSTinfoUnlike the blackpill board, you need to connect the NRST pin to the ST-LINK V2 programmer for STM32G4 series. Alternatively, you can press and hold the NRST button on the Aotenjo One board during the upload process to achieve the same effect.
-
Connect the ST-LINK V2 programmer to your computer.
-
Open the project folder in VSCode.
-
Click on the PlatformIO tab on the left sidebar and click on the
Uploadbutton to upload the firmware to the board.
Now you are ready to control the motor using CAN Bus communication!
For the next steps, please refer to the Aotenjo Master CAN Bus tutorial.