cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H723 Hanging on 'wait till LSE is ready' when using LSI

deanCI
Associate II

Hi,

 

I have an STM32H723ZGT which I am having problems with hanging at boot.

When debugging, it is stuck at 

   /* Wait till LSE is ready */
  while(LL_RCC_LSE_IsReady() != 1)
  {

  }
in main.c
 
I currently have LSE disabled and RTC clock set to LSI, but I still cannot boot past this point.
 
I have VBAT to a coin cell, which is not inserted and have tried power cycles and also extended waiting with power removed.

There was a 32.768kHz crystal on the board, but I have decided not to use this, and tried disabling, and now removing it from the board too.
I also tried LSE in bypass mode with 32.768kHz signal from a generator, but it seems to hang at the same place.


When I first programmed the device, with a release build using LSI, this worked and the processor booted to the user application, and this worked through several power cycles, but once I try to debug it locks at the same point and I can't do anything to recover it.
this is now 2x PCBs that have same behaviour.
1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Why is your code waiting for LSE if it's disabled?

If this is unmodified from an IOC file, please include that IOC file. Otherwise include your main.c file or relevant code. It sounds like when you switched from LSE to LSI you didn't take out some parts of the code that should have been taken out.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

7 REPLIES 7
TDK
Guru

Why is your code waiting for LSE if it's disabled?

If this is unmodified from an IOC file, please include that IOC file. Otherwise include your main.c file or relevant code. It sounds like when you switched from LSE to LSI you didn't take out some parts of the code that should have been taken out.

If you feel a post has answered your question, please click "Accept as Solution".
deanCI
Associate II

That is a good point. 
I thought the clock config function

  /* Configure the system clock */
  SystemClock_Config();

had been auto generated by the clock config tool in the IOC viewer.

Removing all references to LSE in this function seems to fix the issue at this stage.

 

 


@deanCI wrote:

I thought the clock config function ... had been auto generated by the clock config tool in the IOC viewer.


Yes, it should be.

Are you implying it doesn't get auto generated in some instances?

 

 

After changing the IOC, you have to tell it to re-generate - that's how the IOC changes get fed into the C code.

I have been generating the code from the IOC, and also tried cleaning the project before but the references to LSE were still in that function.  As if generating code from the IOC hadn't modified the function.

If you include your IOC we can check it out. Otherwise it's hard to verify and debug.

Most likely situation is the code hasn't been regenerated and recompiled.

If you feel a post has answered your question, please click "Accept as Solution".