cancel
Showing results for 
Search instead for 
Did you mean: 

Error when compiling an MC WB / cubeMX generated app

pjrebordao
Associate II

When compiling a test app for the B-G431B-ESC1 board, I generated code using the MC Workbench and cube MX for a 6-step control of a BLDC.

If while in the Workbench, I choose to enable the "Electronic Speed Control" option, I get the error below when compiling inside the ST IDE:

 

C:/Users/pjreb/.st_workbench/projects/test_4_6s/MCSDK_v6.3.2-Full/MotorControl/MCSDK/MCLib/Any/Src/esc.c:293: multiple definition of `TIM2_IRQHandler'; ./Application/User/stm32g4xx_mc_it.o:C:/Users/pjreb/.st_workbench/projects/test_4_6s/Src/stm32g4xx_mc_it.c:103: first defined here

 

How can I fix this?

 

Thanks

4 REPLIES 4
GMA
ST Employee

Hello @pjrebordao,

Thank you for your problem report.
Selecting another timer than TIM2 (used by ESC) on Workbench Speed Sensing Config should work

GMA_0-1740651589202.png

 

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

I changed to TIM3 and it compiled without errors.

However, now I can't get the motor to run. It wiggles back and forth and mostly doesn't respond to commands.

I also noticed this:

pjrebordao_0-1740659292139.png

 

Shouldn't be updated to TIM3 ?

 

 

Hello @pjrebordao,
First if not already read, i advise you to have a look to the following document:
By reading the chapter 6, you will be able to control the speed of the motor thanks to PWM input signal.
For information, when no PWM signal is present on the input, a periodic tone can be heard. As soon as the input signal is enabled, the tones stop.
However, if you have the motor pilot tool connected you can also make the motor spin thanks to its interface.
If you have a specific motor, i assume that you have created a .json file (with its specific characteristics) to set as input with the inverter board B-G431B-ESC1 of your project creation with MCSDK WB 6.3.2.
This will help to control the motor especially for revup and speed regulation.
 
Hope this will help you.
Best regards.
Fabrice

Hello @pjrebordao,

regarding the ESC timer configuration, the Timer is not configurable and set by default to TImer2

Besides, into a G431B-ESC1 project, Timer1 is set by default (and not configurable) for phases control with PWM signals. Only the Speed timer, used to trig commutation and demagnetization phases of BEMF signals is changeable (i.e. Timer2 or Timer3 in case of usage of ESC).

Best regards.

Fabrice.