2018-02-21 12:23 AM
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é
2018-02-21 06:42 AM
Another bug detected: RCC_DCKCFGR_CK48MSEL define is not active for the STM32F446 inside the stm32f4xx.h file!
2018-02-22 10:03 PM
Please post more information: read out and post the content of RCC and timer registers' content, together with the expected and observed behaviour.
JW
2018-02-23 12:38 AM
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.
RCC configuration with this application:
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:
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:
This means that the clock on the APB1 timers is not X2 but X4 the 45MHz.
Hope this is enough information.
2018-02-23 01:06 AM
And the period is 29.4us?
JW
2018-02-23 01:14 AM
You have DCKCFGR=0x0100'0000, i.e. TIMPRE set.
This is not the default-after-reset setting, so you must have set that actively.
I don't Cube/CubeMX so I am not going to comment on that.
Jan
2018-02-23 02:29 AM
I don't use Cube either, I just used it to get the PLL values.
Sorry I forgot about TIMPRE, the code is from a previous project which I made two years ago. I remember now having seen this X4 for TIMPRE.
The
RCC_DCKCFGR_CK48MSEL remark however is a real bug. I had to modify stm32f4xx.h to get the define acivated.
André
2018-02-23 02:41 AM
I had to modify stm32f4xx.h
You mean that from SPL?
JW
2018-02-23 02:57 AM
Yes, from the latest version available on the website from ST.
André