boards: set stm32 based boards LSI by default#8370
boards: set stm32 based boards LSI by default#8370kYc0o wants to merge 2 commits intoRIOT-OS:masterfrom
Conversation
|
IMHO this needs discussion, also having label |
|
LSE presence can be autodetected on startup by adding timeout to "while (!(RCC->REG_LSE & BIT_LSERDY)) {}" in stmclk_enable_lfclk. E.g. enable LSI, then try to enable LSE, if after 60k LSI cycles LSE is not ready yet — stay with LSI. P.S. We are doing the same thing for autodetecting HSE/HSI — some of our boards don't have HSE crystal installed and we don't want to bother users with separate firmware versions. |
Yes I know, what I think is that it's important to have this board in a functional state for the release, which is not the case right now. |
Wow great! Thanks @olegart, I'll implement that function instead. |
|
Superseded by #8545. |
Contribution description
Some board configurations can vary according to the revision, especially on ST discovery and nucleo development boards.
This PR sets the default low speed clock source to LSI, which is always present regardless of the revision. While I acknowledge the preference for LSE (more accurate), for the sake of functionality, LSI should be set by default, unless we know all revisions have LSE. Otherwise, boards simply don't work when RTC is used, and it's used by default on all ST platforms.
According to UM1724, revision MB1136 C-01 on, as far as I can tell, all nucleo64 boards don't have neither HSE and LSE, thus risk to be broken on master.
In this PR I'm only fixing nucleo-l152 and stm32f4doscovery, but I'd advice to change all to LSI by default. Comments welcome!
Issues/PRs references
#7504 (3897d00) enabled LSE on nucleo-l152 and #7158 (b3e7dd8) for stm32f4discovery
Fixes #8240, though is already closed.