Skip to main content
Junde
Senior III
June 18, 2025
Solved

Changing MCSDK6 config overwrites CubeMX configurations

  • June 18, 2025
  • 3 replies
  • 521 views

Hi there,

I am newbie to motor control, and I am studing how to use the excellent tool named MCSDK6.

Below is my work follows(MCU is STSPIN32G4):

1. open MCSDK6 and select my custom board and motor, generate the project;

2. open cubeMx configurate the others PINs, then generate the project;

3. write some app code;

4. i find the motor config is something wrong, so I open MCSDK6, change the config and generate the project again;

5. then I found the config in step2 is lost.

Is anything I did wrong? I think if the config could keep is better.

Thanks for you help.

Best answer by cedric H

Hello @Junde,

To complete Gael's answer, be aware that once you have generated your project and if you want to modify your IOC to include your own peripherals with cubeMX, you can re-load this modified motor control IOC directly with the workbench. Doing so, you will be able to change your motor control algorithm configurations, but all the parts related the hardware configs are not accessible anymore. The new generated IOC will modify only the motor control component, and will keep untouched the HW part. So your modification will be kept, but it is also the reason why when you start from a motor control IOC the workbench prevents you to do any modification related to HW config.

I hope it's clear.

Regards

Cedric

3 replies

Gael A
ST Employee
June 18, 2025

Hello Junde,

Thank you for your post. I am sorry to inform you that this is an absolutely normal behaviour and that it can be listed as one of the limitations of our tool. When generating a Motor Control project, the WorkBench always create the .ioc file from scratch and thus any CubeMX modification is overwritten. However, user code is maintained after CubeMX generation as long as the code is located in the User Code brackets.
Thank you for your understanding.

If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.Hope this will help,Gaël A.
Junde
JundeAuthor
Senior III
June 19, 2025

@Gael A 

Thank you for your reply.

I am just making sure that my process isn't something wrong.

So we'd better configure our motor-related profile in step 1 and keep it in late development.

cedric H
cedric HBest answer
Technical Moderator
June 19, 2025

Hello @Junde,

To complete Gael's answer, be aware that once you have generated your project and if you want to modify your IOC to include your own peripherals with cubeMX, you can re-load this modified motor control IOC directly with the workbench. Doing so, you will be able to change your motor control algorithm configurations, but all the parts related the hardware configs are not accessible anymore. The new generated IOC will modify only the motor control component, and will keep untouched the HW part. So your modification will be kept, but it is also the reason why when you start from a motor control IOC the workbench prevents you to do any modification related to HW config.

I hope it's clear.

Regards

Cedric

Junde
JundeAuthor
Senior III
July 10, 2025

Hi @cedric H 

Thanks for your explanation.

I already tried it and it works!

Junde
JundeAuthor
Senior III
November 3, 2025

1. Create the MCSDK project.

2. Open the .ioc file in CubeMx to configure other functions;

3. Open the .ioc file in MCSDK to configure the motor relative function;(In this way, the config in step 2 can be saved)