You can find the schematics and PCB in the link below :
The sample code :
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.