***Error in generate TIM code ***
When I use a formula to set the prescaler instead of a specific value, an unexpected macro will appear in the generated code.
This problem does not appear on STM32CubeMX.
Is this a BUG?


When I use a formula to set the prescaler instead of a specific value, an unexpected macro will appear in the generated code.
This problem does not appear on STM32CubeMX.
Is this a BUG?


Hello @WJack.1
First let me thank you for posting.
Indeed, I am able to reproduce this misbehavior.
The main reason for it is that those zone in CubeMx are dedicated by default to integers and the tool does not recognize the arithmetic operands to do the mathematic operation.
Also, the tool is detected when the value is not an integer and grey out those parameters:
But the expected behavior should be that CubeMx set the value as "No Check" and copy it to the generated code:
I propose that you choose the "No Check" option manually as a temporary solution.
With this being said, this problem is raised internally to be reviewed. I'll keep you posted with the updates.
Internal ticket number: 136601 (This is an internal tracking number and is not accessible or usable by customers).
Thanks for your contribution.
Semer.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.