2025-02-27 1:50 AM
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
2025-02-27 2:20 AM
Hello @pjrebordao,
Thank you for your problem report.
Selecting another timer than TIM2 (used by ESC) on Workbench Speed Sensing Config should work
2025-02-27 4:28 AM
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:
Shouldn't be updated to TIM3 ?
2025-02-27 9:44 AM
2025-02-27 10:10 AM
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.