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,

STEVAL-SPIN3202 uses one shunt for current sensing and is based on STM32F0.

The FOC duration error is due to a two fast PWM frequency. You should stay under 12Khz PWM frequency to avoid FOC duration. If it does not fit with your motor requirement, you can increase the frequency but change the execution rate from each period to 2 PWM periods.

Regarding the Overcurrent, It could be that your start-up parameters configuration ask to much current. Try to decrease the Final current number.

Regards

Cedric

Hello Cedric

I've been trying to set parameters as you told me, but I've obtained nothing. The motor doesn't spin at all. I can only hear a little "tic" when I press "Start Motor" in the monitor window of Workbench. No error or fault led is on. Only Idle state is on, even though I started the motor. I've tried different values for the startup procedure, changing times, currents, speeds. The result doesn't change at all.

I've checked STEVAL-SPIN3202 jumpers and they are as indicated in datasheet.

I've changed PWM frequency down to 5KHz. I've tried to redo the entire project. Nothing to do...

I've entered correct motor values, from datasheet characteristics.

It seems to me that motor try to align, but after that there's no action. I can't see errors: no overcurrent, no FOC duration, no startup failure!

Another thing: if I use Debugger and I connect the monitor, when I launch "start motor" command an hard fault interrupt is triggered. I think that I can't use Debugger and monitor concurrently.

I don't really know how to solve the question....

Roberto

PKulk.2
Associate II

I was facing the same issue for many days & I also tried to switch from versions of STMCubeMx & diferent IDEs.

But it is very silly issue & solution to it also very easy.

You just have to install the Java Run Time Environment (JRE) 8 or below JRE 10 & boom!!! it will work properly with any IDE.

Uninstall the JRE latest versions if you have any(e.g. JRE 14 or JRE 15) & keep only one JRE10 or below v10.

I'm using JRE8. STMCubeMx doesn't support JRE above 10.

You don't have to change anything else. (Project directory, names etc)