You can find the schematics and PCB in the link below :

The sample code :

https://github.com/Navid-Sabet/Dog-robot/tree/main/BLDC-driver/3pwm%20single%20module/SW/bluepill_foc

This code is based on simpleFOC library and Arduino STM32 firmware.

With sending a simple string like "M10" the motor will rotate 10 rad.

The letter 'M' is used for motor commands, 'C' is for PID, and 'J' is a custom code that will respond with a JSON string containing the current position and velocity.