cancel
Showing results for 
Search instead for 
Did you mean: 

Bug with Cube, 4.21 and F7 AHB1 timer clock

Uwe Bonnes
Principal II
Posted on May 17, 2017 at 10:57

Hello,

it seems cube does not take care of time TIMPRE x4 multiplier for the AHB1 timer clock

Note: this post was migrated and contained many threaded conversations, some content may be missing.
10 REPLIES 10
Nesrine M_O
Lead II
Posted on May 17, 2017 at 11:39

Hi

Bonnes.Uwe

,

Please make sure that theTIM Prescaler selection is enabled from RCC configuration tab:

0690X00000606v5QAA.png

-Nesrine-

Posted on May 17, 2017 at 12:30

Dear Nesrine,

thanks for the hint. However when setting the frequency field for AHB1 timer clock to 200 Mhz, cube tries hard to find a solution, but does not come up with the  'TIM Prescaler selection from RCC configuration'.

Posted on May 17, 2017 at 14:39

Hi

Bonnes.Uwe

,

I' am not able to reproduce the issue that you describe :

  • when the TIMPRE bit in the RCC_DCKCFGR1 register is set, if APBx prescaler is 1,2 or 4, then TIMxCLK = HCLK, otherwise TIMxCLK = 4x PCLKx.

  • When TIMPRE bit of the RCC_DKCFGR1 register is reset, if APBx prescaler is 1, then TIMxCLK = PCLKx, otherwise

    TIMxCLK = 2x PCLKx

0690X00000606zfQAA.png

Could you please share your *ioc file for check?

-Nesrine-

Posted on May 18, 2017 at 11:02

Dear Nesrine,

do it the other way round. Start with a new project, change to the clock configuration view, set up PLL to run at highest speed, correct all AHB/APB prescalers so that all bus speeds are in the limit. Now the ABPx timer clocks are twice the value of the corresponding ABPx clock. No change the APB1 timer clock frequency input field to the value of HCLK. Cube starts to find a solution, but does not come up with TIMPRE and offers no solution. Cube should consider TIMPRE in that case.

Posted on May 18, 2017 at 12:02

Hi

Bonnes.Uwe

,

I followed all steps that you describe but I am not able to reproduceyourissue.

So could you please share

the STM32CubeMX.log file that you find under your user directory in the .stm32cubemx folder?

-Nesrine-

Posted on May 18, 2017 at 12:41

I don´t see a possibility on this page to share a file...

Posted on May 18, 2017 at 14:37

Hi

Bonnes.Uwe

,

Please use advenced editor

0690X00000606vXQAQ.png

-Nesrine-

stm32cube-t
Senior III
Posted on October 19, 2017 at 14:42

Hello,

Please note the following feature on CubeMX clock tree. By right clicking the clock tree, you can lock a value you want to remain unchanged (HCLK here), then to reach 200MHz for the timer the timer pre-scaler will be adjusted fine0690X00000608YLQAY.png.