Skip to main content
sneal
Associate II
September 16, 2022
Solved

STM32 U575 LSE Clock doesn't start.

  • September 16, 2022
  • 7 replies
  • 2281 views

LSE clock is set in the Cube and initialised

After intitialisation the following registers are not set correctly and the LSE clock isn't called

RCC->BDCR->LSEDRIVE not set to hight event though macro called

RCC->BDCR->LSCOSEL set to LSI

RCC->BDCR->LSCOEN not set

This looks to be a bug in the HAL library

This topic has been closed for replies.
Best answer by sneal
Hi Mike,
I found the problem
I was calling __HAL_RCC_PWR_CLK_ENABLE();
Before SystemClock_Config which was why the __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_HIGH)
Didn’t work.
All fixed now
Kind regards
Sue

7 replies

Mike_ST
ST Technical Moderator
September 16, 2022

Hello,

If you can, please share the.ioc file as you are using CubeMX or IDE, or share some code, so that the community can check/reproduce/help.

Does this happen on a nucleo board ?

>> This looks to be a bug in the HAL library

That can happen, but we need more inputs.

Thank you.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. 
sneal
snealAuthor
Associate II
September 16, 2022
Hello,
Yes this happens on a nucleo board as well
Have attached project
Sue
waclawek.jan
Super User
September 19, 2022

> I was calling __HAL_RCC_PWR_CLK_ENABLE();

> Before SystemClock_Config which was why the

> __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_HIGH)

> Didn’t work.

I fail to see the causality here.

JW

sneal
snealAuthor
Associate II
September 23, 2022
__HAL_RCC_PWR_CLK_ENABLE()
Enabled the LSE clock so that the call to __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_HIGH)
Didn’t work as the clock was enabled and the calls can only work if disabled.
Piranha
Principal III
September 26, 2022

Enabling the clock for PWR peripheral has nothing to do with RCC_BDCR register, in which the LSE is configured.