2014-03-26 03:26 AM
In the user manual: AN2606 - STM32 microcontroller system memory boot mode it describes that when using a 14.7456MHz clock crystal the bootloader configures the PLL to run at 48MHz. How is this achieved? What settings do I need to get this clock frequency?
Best regards,Andreas2014-03-26 08:34 PM
Figure it benches HSE vs HSI, and then generates ~48 MHz with perhaps 0.16% error.
2014-03-28 02:06 AM
Oh, I guess that could be done. I tried running the USB PHY at 5*14,7456*2/3=49,152MHz and it still worked, but I wouldn't be happy to deliver a product with this.
So I guess the best approach would be to calibrate the HSI using the HSE and then run the USB of that one? :\Best regards,Andreas2014-03-28 08:34 AM
((14.7456 / 15) * 195) / 4 = 47.9232 MHz
(1 - (47.9232 / 48.0000)) * 100 = (1 - 0.9984) * 100 = 0.16 %2014-03-28 08:37 AM
Could have sworn the post originally referred to an STM32F4 part, although I may have inferred it from the app note.
49.152 has a 2.4% error Further more, you should know what crystal you're using, the boot loader doesn't know, which is why it has to make computations. I believe it could use a larger range of crystals than the app note suggests, as there are no specific references to 14.7456 MHz that I can see.2014-03-28 01:15 PM
freq=7456
cpu= 9616, usb= 9232, err= 0.16%, pll_m=15, pll_n=195, pll_p=8, pll_q=4
cpu=9945, usb= 9984, err= 0.00%, pll_m=14, pll_n=319, pll_p=2, pll_q=7