Skip to main content
andre239955_st
Associate III
February 21, 2018
Question

BUG: STM32F446 timers on APB1 run faster than indicated in Cube and datasheet

  • February 21, 2018
  • 2 replies
  • 1666 views
Posted on February 21, 2018 at 09:23

Hi all,

We use the STM32F446 for a new project. We noticed that the clock for the timers on the APB1 is x4 instead of x2 when the APB1 prescaler is not equal to 1. 

In our test we have used a system clock of 168MHZ and APB1 prescaler /4 which gives 42MHz. Cube says that the APB1 timer clock is 84MHz but my output signals on the timers are twice as fast. We have checked the 42MHz on the other APB1 peripherals with UART5, there the timing is correct.

Please udate the reference manual and the Cube for this device.

And maybe also indicate that the USB peripheral for this device is like the F7 USB core...

Thanks,

André

    This topic has been closed for replies.

    2 replies

    andre239955_st
    Associate III
    February 21, 2018
    Posted on February 21, 2018 at 15:42

    Another bug detected: RCC_DCKCFGR_CK48MSEL define is not active for the STM32F446 inside the stm32f4xx.h file!

    waclawek.jan
    Super User
    February 23, 2018
    Posted on February 23, 2018 at 07:03

    Please post more information: read out and post the content of RCC and timer registers' content, together with the expected and observed behaviour.

    JW

    andre239955_st
    Associate III
    February 23, 2018
    Posted on February 23, 2018 at 08:38

    Ok, here is some additional information.

    Debugging has been done with TIM4 which is on APB1.

    APB1 clock is mentioned by Cube MX to be 90MHz. Following the reference manual this should be right.

    0690X000006042JQAQ.jpg

    RCC configuration with this application:

    0690X00000604HNQAY.jpg

    In the picture above it can be seen that the bit CK48MSEL is present for this micro (second bug mentioned). I use the USB and it is working correctly which proves it.

    Now for the clock multiplication for APB1.

    Here are the registers of TIM4:

    0690X00000604MkQAI.jpg

    TIM4 CCR4 is set to 0x03A7 = 935. For the pulse length this would be 1/90E+06 x 936 = 10.4 micro seconds.

    Measuring with a scope on the output gives HALF this time:

    0690X00000604PiQAI.jpg

    This means that the clock on the APB1 timers is not X2 but X4 the 45MHz.

    Hope this is enough information.

    waclawek.jan
    Super User
    February 23, 2018
    Posted on February 23, 2018 at 09:06

    And the period is 29.4us?

    JW