cancel
Showing results for 
Search instead for 
Did you mean: 

***Error in generate TIM code ***

WJack.1
Associate

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?

0693W00000Unmk0QAB.png0693W00000UnmkKQAR.png

1 ACCEPTED SOLUTION

Accepted Solutions
Semer CHERNI
ST Employee

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:

0693W00000UnvJNQAZ.png 

But the expected behavior should be that CubeMx set the value as "No Check" and copy it to the generated code:

0693W00000UnvJmQAJ.png 

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.

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.

View solution in original post

2 REPLIES 2
Semer CHERNI
ST Employee

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:

0693W00000UnvJNQAZ.png 

But the expected behavior should be that CubeMx set the value as "No Check" and copy it to the generated code:

0693W00000UnvJmQAJ.png 

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.

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.

Thank you for your reply.I have implemented what I need.:grinning_face:

BTW, Maybe there was something wrong with my previous test, STM32CubeMX has the same BUG.

​

​

​