2020-09-10 04:16 AM
Hi,
I'd like to report a bug in code generation of CubeMX when using encoder mode with remapping of CH1 and CH2 and LL drivers. I use STM32CubeIDE v1.4.1 and STM32G474.
The problem is that the commands to configure the remapping of TI1 and TI2 are split into two calls to "LL_TIM_SetRemap" (example for TIM3):
...
LL_TIM_SetRemap(TIM3, LL_TIM_TIM3_TI1_RMP_COMP2);
LL_TIM_SetRemap(TIM3, LL_TIM_TIM3_TI2_RMP_COMP3);
...
The second call to "LL_TIM_SetRemap" erases the setting in the first command (since it uses "MODIFY_REG" under the hood, clearing all remap bits by default).
The correct code would be combining the settings in a single command like so:
...
LL_TIM_SetRemap(TIM3, LL_TIM_TIM3_TI1_RMP_COMP2 | LL_TIM_TIM3_TI2_RMP_COMP3);
...
A screenshot of CubeMX configuration example is attached.
2020-09-10 06:04 AM
Hi @MScho.1 ,
It would be more helpful if you can share your .ioc file.
Are you using STM32CubeMX 6.0.1?
Thanks,
Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2020-09-10 06:16 AM
2020-09-10 06:24 AM
Thanks @MScho.1 ,
Not a matter of being lazy :), but I didn't got same view as yours:
First what I will do is to align to latest CubeMX version (6.0.1).
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2020-09-10 06:35 AM
Just migrated to CubeMX 6.0.1, problem is still present.
2020-09-10 09:27 AM
Hi @MScho.1 ,
Using STM32CubeMX 6.0.1, I was able to reproduce the issue and confirm it for both LL and HAL generated code.
This is reported to our development team who will take care to integrate relevant fixes.
Thanks for bringing this to our attention.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.