1
\$\begingroup\$

I want to use RTC of STM32F4. When I configure this with LSI, I have no problem. But when I use LSE, I have a timeout error in SystemClock_Config function when it wants to configure RCC Source with HAL_RCC_OscConfig(&RCC_OscInitStruct).

Another question is which type of oscillator should be used for LSE?

\$\endgroup\$
1
  • \$\begingroup\$ Did you even provide a low frequency "watch crystal" for it yet? \$\endgroup\$ Commented Feb 12, 2019 at 15:32

3 Answers 3

4
\$\begingroup\$

ST provide a detailed guide on crystal selection as well as a number of recommended parts, it is AN2867 Application note Oscillator design guide for STM8AF/AL/S and STM32 microcontrollers.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Maybe it's worth including the title AN2867 Application note Oscillator design guide for STM8AF/AL/S and STM32 microcontrollers. Links change more often than AN numbers and titles. \$\endgroup\$ Commented Feb 12, 2019 at 14:07
0
\$\begingroup\$

In the AN2867 application note at page 27-28 we can see a table of recommended crystal resonators for the LSE oscillator in STM32 microcontrollers.I think I should change my crystal to solve these errors.

\$\endgroup\$
0
\$\begingroup\$

There is an errata that ST put out. In it, it said, "The PC13 input/output toggling disturbs the LSE. As a result, PC13 might not be usable when LSE is used." The workaround is: "Use an external clock with the LSE in bypass mode."

\$\endgroup\$
2
  • \$\begingroup\$ Could you edit and add a link, if possible? \$\endgroup\$ Commented Jul 3, 2023 at 19:54
  • \$\begingroup\$ The errata is true, it is said in other erratas for other STM32 MCUs as well. But the timeout happens during when HAL is initializing the system clocks, which happens very early before any other peripherals or GPIO pins are initialized, so it is extremely unlikely that something is toggling PC13 while the LSE is being initialized, so this answer unlikely provides a correct explanation for why the LSE does not start. \$\endgroup\$
    – Justme
    Commented Jul 3, 2023 at 20:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.