A sample PlatformIO project for the SimpleFOC compatible Lepton BLDC driver board, based on a STM32G031G8U6 MCU.
Please see also the following thread in the SimpleFOC Community for more information on the Lepton.
Feel free to clone/fork this repository to start your own Lepton-based project.
Intended for use with chip's built-in bootloader, no extra bootloader needed. Program using the SWD connection and a ST-Link programmer.
Power the board externally (ST-Link should not supply power).
Serial can be connected to the ST-Link V3's RX/TX pins or to another TTL Serial to USB adapter to interface with your PC.
The Lepton's RX/TX pins are mapped to the Arduino Serial
object, so you can just use Serial.begin(115200);
(for example).
In the same way, the Lepton's I2C port is mapped to the Arduino Wire
object, and the Lepton's SPI port to the Arduino SPI
object.
This should let you use the built in Serial, Wire (I2C) and SPI functions with no special setup code.
Schematic for V2 or the lepton, available on EasyEDA.
Based on the following pin configuration:
The project uses the following clock configuration: