Skip to main content
Visitor
August 24, 2026
Question

How to implement FOC BLDC driver with STM32H725RGV3 based PCB

  • August 24, 2026
  • 2 replies
  • 91 views

Hi there, 

I am after some advice on the best way to implement an FOC BLDC controller on an STM32H725RGV3 based board. I’ve inherited this board and as a result am not able to choose the microcontroller that exists on it. If it were up to me, I would’ve chosen a device from the STM32G4 range. Regardless, I ideally would like to use X-CUBE-MCSDK so I am not re-inventing the wheel, however, the closest boards are the NUCLEO-H745/55ZI-Q which is a dual core stm32h7 based board.

Current reading topology: Three Shunt Resistors 

Control schemes required: FOC (torque control), speed and position control with absolute encoder.

Comms interface: CANBus (expect to implement business logic myself)

Modulation technique: Ideally SVPWM (is this the default)

Motor: Custom

What is the prescribed workflow for this application? Should I create a board based on the NUCLEO-H745/55ZI-Q and then attempt to modify the IOC to match my board? I was considering trying to use the example project “FOC STM32H745ZI with IHM08 example” but the position control option is greyed out.

Thanks!

2 replies

Senior III
August 24, 2026

I would not start with the H745 example and simply modify its .ioc file. The H725 and H745 differ in their clocking, ADC, DMA and timer configuration, while the generated code from ST’s X-CUBE-MCSDK depends heavily on those peripherals.

First check whether your exact STM32H725 device can be selected in the installed Motor Control Workbench version. If it is unsupported, using an H745 project as a template will require a manual port rather than normal CubeMX pin reassignment.

A reasonable workflow would be:

  1. Document the existing PCB connections for the three current-sense channels, gate-driver signals, DC-bus measurement, encoder and protection inputs.
  2. Assign TIM1 or TIM8 for complementary PWM, dead time and ADC triggering.
  3. Configure three-shunt synchronized ADC sampling and verify the current readings before connecting the motor.
  4. Bring up basic FOC in torque mode, followed by speed control.
  5. Add the position loop only after current and speed loops are stable.
  6. Implement CAN communication separately around the motor-control APIs.

SVPWM is normally used by the MCSDK FOC implementation. The greyed-out position option is probably related to the selected MCU/board configuration or supported feedback type. MCSDK traditionally supports incremental quadrature encoders and Hall sensors, but a generic absolute encoder may require a custom position-feedback interface and an outer position-control loop. For anyone needing a refresher on the motor’s construction and electronic commutation, this brushless DC motor overview provides useful background.

I would first generate the closest supported single-core H7, three-shunt FOC project, study its timer/ADC architecture, and then port those MCSDK components carefully to the H725. Do not run the power stage until PWM polarity, dead time, break input and overcurrent shutdown have been verified on a scope.

hr-devAuthor
Visitor
August 24, 2026

Hi there, thanks for your response. Using the board manager in MCSDK It looks like my exact STM32H725 cannot be selected / is not supported, so I’ll need to do the manual port as per your suggestion. Thanks for your advice. I’ll report back as to how I go. Are there any alternatives you can suggest? Perhaps using simpleFOC or ODrive may be easier? Cheers