Home > other >  STM32H7 RTC_CLOCK_SOURCE_LSE problem
STM32H7 RTC_CLOCK_SOURCE_LSE problem

Time:09-15

STM32H7 do a show calendar program, use the website code, set to LSI clock is normal, but after shut electric (a battery back-up) clock does not walk, change the LSE after the crash, the code is as follows:
@ file RTC/RTC_TimeStamp/Inc/main h

/* Defines related to Clock configuration */
/* Uncomment to enable the adaquate Clock Source */
//# define RTC_CLOCK_SOURCE_LSI
# define RTC_CLOCK_SOURCE_LSE

Tracking found stuck in this place:
@ file stm32h7xx_hal_rcc. C
/* Set the new LSE configuration -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - */
__HAL_RCC_LSE_CONFIG (RCC_OscInitStruct - & gt; LSEState);
/* Check the LSE State */
If ((RCC_OscInitStruct - & gt; LSEState)!=RCC_LSE_OFF)
{
/* Get Start Tick */
Tickstart=HAL_GetTick ();

/* Wait till LSE is ready */
While (__HAL_RCC_GET_FLAG (RCC_FLAG_LSERDY)==0 u)
{
If ((HAL_GetTick () - tickstart) & gt; RCC_LSE_TIMEOUT_VALUE)
{
Return HAL_TIMEOUT;
}
}
}

Ask everybody to give directions

CodePudding user response:

The LSE crystals did not start up?

  • Related