2020-12-18 03:43 AM
My platform is:
STM32F407IG ,MotorControl Workbench 5.4.4,IAR EMARM V8,STM32 FW V1.24.1
When I use both the Hall sensor and the encoder, the encoder serves as the Main sensor and the Hall sensor as the Auxiliary sensor.The code it generates has a warning:
Warning[Pa181]: incompatible redefinition of macro "SPD_TIM_M1_IRQHandler" (declared at line 268)
It prompted me to define both the Hall sensor and the encoder timer as SPD_TIM_M1/2_IRQHandler.And the notes are all hints as AUXILIARY ** TIMER MOTOR.
When I was debugging, the program got stuck after “HAL_NVIC_EnableIRQ(TIM5_IRQn);�?
It loops around here:
Is my engineering configuration not right or cannot be used in this way,If you encounter this problem, please communicate with me.
Thank you so much.
Solved! Go to Solution.
2021-01-03 06:06 PM
Oh,Hi�?happy new year!
I've solved it.I guess it was a bug generated when generating code.
I added the TIM interrupt used by the encoder.And renamed the macro definition of the encoder capture.And it works.
Change the name of the duplicate macro definition:
Write interrupt functions 1:
Channel two is the same as channel one.
Best regards
Tengjie Li.
2020-12-31 09:07 AM
Dear @TLi.3
Sorry for the late answer.
Do you have still this problem to solve?
And just in case, if not, do not hesitate to share the final solution you found. Thanks by advance.
Best regards
Laurent Ca...
2021-01-03 06:06 PM
Oh,Hi�?happy new year!
I've solved it.I guess it was a bug generated when generating code.
I added the TIM interrupt used by the encoder.And renamed the macro definition of the encoder capture.And it works.
Change the name of the duplicate macro definition:
Write interrupt functions 1:
Channel two is the same as channel one.
Best regards
Tengjie Li.
2021-06-27 08:17 PM
The question has been set only to the "STM32 Motor Control" topic (the question is only about the STM32 MC SDK).
Best regards