Request for Design Feedback: STM32G4 + DRV8316 BLDC Controller PCB

SPI Pin Conflict

  • Theres some flexibility with STM32 peripherals. Some are exposed on more than one pin. In your case, the SPI2 can be configured like this

  • You can share an SPI Interface between the internal encoder and external encoder if you wont use both simultaneously.

  • This mcu can be configured without external crystal also. Here’s a thread discussing the speed variation without the HSE Arduino Mini R4 poor performance - #39 by jazzboy

I2C reliability

  • I2C was developed for intra board communication. So it does not have the noise resilience as other protocols such as CAN or USB.

  • If you’re using it in a gimbal setup or a mini robot arm, it shouldn’t be a problem.

  • So if you have extra pins, you can add an I2C connector

  • These references might be helpful:

Flashing via USB-C

  • I had the same doubt when designing MicroSpora. The MCU has factory bootloader, it can be directly programmed from the Arduino IDE using USB DRV8316 + STM32G431 design request for comments - #4 by runger

  • Pressing RST while holding the BOOT button will put the MCU in upload mode. Code can then be uploaded from Arduino IDE.

  • Using ST-link or USB during development is your choice, but it is a good practice to expose SWDIO and SWCLK pins.

Notes and Suggestions:

  • The DRV8316 is low current driver. It is not suitable for driving A2212 motor with high loads. Microspora was tested on A2212 motor with light loads and slow speeds.
  • If this is your first PCB, I would suggest to make the board at a comfortable size and not too compact. Exposing test pins can be helpful for troubleshooting

I wish you good luck on this project. Since you’re from Software background, the firmware part shouldn’t be an issue for you.

My case was the opposite, It took me two days just to get the motor running. Without the guidance from Runger, it would have been impossible.

Can you share more info about your project and use case