Skip to main content
Graduate II
May 17, 2017
Question

Bug with Cube, 4.21 and F7 AHB1 timer clock

  • May 17, 2017
  • 3 replies
  • 2169 views
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.
    This topic has been closed for replies.

    3 replies

    Visitor II
    May 17, 2017
    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-

    Graduate II
    May 17, 2017
    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'.

    Visitor II
    May 17, 2017
    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-

    ST Employee
    October 19, 2017
    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.

    Graduate II
    March 20, 2024

    I'm also finding this problem.  I suspect the HAL lib code doesn't take the TIMPRE setting into account and thus it calculates the wrong divider settings for the timer.