cancel
Showing results for 
Search instead for 
Did you mean: 

Motor control Workbench/STMCubeMX code generation don't create a buildable software

Roberto Giovinetti
Associate III

Hello everyone

I'm trying to use Motor Control tools to generate a project, but I can't get any result: every project I get from code generation is not buildable and I get a lot of errors.

I'm using Motor Control Workbench 5.4.0 and I'm using STEVAL-SPIN3202. I choose parameters, and I start to generate the software. In project generation I choose STM32CubeMX 5.2.1. In the Target Toolchain I choose ST True Studio (but I've tried STSW4STM32 and STM32CubeIDE also). In the firmware package option I choose the one the program suggest me.

Then I generate the code and this step works fine. A the end of this step I open STM32CubeMX and I generate the code. Everytihing works well until here. Problems begin when I open the project and I try to build it: there's no way! A lot of errors appears and I can't get a working debuggable project to test motors and hardware.

It's very frustrating. I can't understand where the problem is. As I told before, I used ST True studio, AC6 SW4STM32 and I downloaded and used STM32CubeIDE, but no one of this work.

Where am I wrong?

Thank you

Roberto

12 REPLIES 12
cedric H
ST Employee

Hello Roberto,

Could you please provide the log file that is generated in the project folder (project_name,log) , and the stmcx you used if it is not confidential.

Regards

Cedric

Roberto Giovinetti
Associate III

Hello Cedric

I have to reply twice because the name of the file, for the system, is the same. First one log file.

Hello Cedric

Second one, stcmx file.

Roberto

cedric H
ST Employee

Hello Roberto,

I just tried your stmcx file and I compiled your project successfully.

I have a doubt regarding the project generation, and I wonder if everything is OK.

Could you confirm me that the mc_task.c of your generated project is the same than the one I just generated with your stmcx and attached to this post.

Thanks

Cedric

Dear Cedric

My mc_tasks is completely different! Is just empty... I don't know why.

I attach my generated one. I found it in the {project}\src folder.

Roberto

Hello Roberto,

Your problem comes probably from the fact that cubeMX does not find the template source of the Motorcontrol libraries.

Could you try to :

  • start CubeMX,
  • In the Help menu, click on Updater Settings.

From this be sure that the CubeMx repository folder path is correct, with a "\" at the end of the line.

For instance, mine is :

C:\Users\cedricH\STM32Cube\Repository\

Once it is done, you can open your generated ioc file and click on generate from CubeMX.

Let me know if it does the job.

Regards

Cedric

Hello Cedric

I've done as you suggest me, but I did not obtain anything: mc_tasks is still empty, and errors are the same.

I've added a "\" a the end of the repositry path (you were right, '\' missing), but it doesn't the job.

When I opened project with Atollic TRUEStudio (9.0.1) I cleaned the project, than I did "build" but error messages are the same.

So I returned to WorkBench, I re-generate software, re-open in CubeMX the new ioc file, re-generate project from CubeMX and opened it in Atollic: in this way it does the job and I've not had errors in build session. Later I'll try software comunication with STEVAL-SPIN3202.

Thank you very much

Roberto

Ok, great to hear that your issue is fixed.

Now, you can generate directly from the Workbench, no need to manually open cubeMX to launch the code generation.

Workbench calls cubeMX behind the scene.

Regards

Cedric

Hello Cedric

During this week, I've tried to get motor spin using workbench and STEVAL-SPIN3202, but unsuccessfully. I've tried to change parameters in workbench. I've tried different values. But no way. Every time I try to start the motor I get or "FOC duration" or "Overcurrent". I cannot understand why, because the motor is not stalled, is free running.

Parameters I've put are correct: inductance, resistance, pole pairs, current, ecc.

I hope you can suggest me how to obtain a spinning motor.

Thank you very much.

Roberto