[riot-notifications] [RIOT-OS/RIOT] cpu/stm32f2f4f7: expose clock configuration in kconfig (#15632)
notifications at github.com
Mon Jan 4 14:04:59 CET 2021
@aabadie commented on this pull request.
> + default 96 if CPU_FAM_F4 && CLOCK_MAX_100MHZ && BOARD_HAS_HSE && (MODULE_PERIPH_USBDEV || USEMODULE_PERIPH_USBDEV)
+ default 48 if CPU_FAM_F4 && CLOCK_MAX_100MHZ && (MODULE_PERIPH_USBDEV || USEMODULE_PERIPH_USBDEV)
The problem is about the default clock speed. In RIOT, we try to have the maximum possible clock speed.
By default, some F4 are able to run at 100MHz or 180MHz but this clock speed is not compatible with USB (because a 48MHz clock cannot be generated from the main PLL running at 100MHz/180MHz).
Some CPU provides alternative 48MHz sources (f412/413 for example can use one output of PLL I2S), so in this case this is not an issue, just enable the right PLL I2S output and you get the best of both worlds. But for others (f411, f446), there's no alternative and the main PLL must be changed if the user needs USB.
If no 48MHz clock source can be configured, the build fails.
Previously, F4 capable of running at 100MHz/180MHz were down clocked to 96MHz/168MHz, to be able to work in any situation. But I found this less optimal in most of the cases where USB (or HWRNG) is not needed.
With the current approach, we can guarantee an optimal and working clock speed in any case (with and without USB), without having to change anything.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications