2019-07-01 02:10 AM
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
2019-07-09 08:48 AM
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
2019-07-09 09:54 AM
2019-07-09 09:54 AM
2019-07-09 10:14 AM
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
2019-07-09 10:26 PM
2019-07-10 03:32 AM
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 :
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
2019-07-10 04:52 AM
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
2019-07-10 06:07 AM
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
2019-07-16 11:10 PM
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