Skip to main content
Associate II
September 16, 2026
Solved

SPI and Dual UART Configuration with MC Workbench

Dear ST Community,

I am working on an STM32 motor control project using MC Workbench and would like to configure one SPI interface and two UART interfaces in addition to the motor control peripherals.

Is it possible to configure SPI and two UARTs while using MC Workbench?

I tried configuring these peripherals by modifying the generated .ioc file in STM32CubeMX. However, when I regenerate the project/code, some of the peripheral configurations are overwritten by the MC Workbench-generated configuration.

Could you please suggest the recommended approach for this use case? Specifically:

  1. Is there a supported way to configure SPI + two UARTs directly through MC Workbench?
  2. If not, what is the recommended method to add these peripherals without their configuration being overwritten?
  3. Should the peripherals be configured in the .ioc file after MC Workbench code generation, or is there another recommended integration method?
  4. Are there any specific USER CODE sections, middleware, or configuration files where I should add the initialization and application code?

I would appreciate any guidance or example for integrating additional peripherals with an MC Workbench-generated project.

Regards,
Prathmesh

GMA
GMABest answer
ST Technical Moderator
September 28, 2026

Hello ​@prathmeshpatil06,

After the STM32CubeMX SPI/UART modifications, use the STM32CubeMX tool to generate the project.

If motor control parameters must be changed, first load the modified .ioc file into MC Workbench.

If you agree with the answer, please accept it by clicking on 'Best answer'.Best regards.GMA

1 reply

GMA
GMABest answer
ST Technical Moderator
September 28, 2026

Hello ​@prathmeshpatil06,

After the STM32CubeMX SPI/UART modifications, use the STM32CubeMX tool to generate the project.

If motor control parameters must be changed, first load the modified .ioc file into MC Workbench.

If you agree with the answer, please accept it by clicking on 'Best answer'.Best regards.GMA