Skip to main content
Senior
May 23, 2021
Question

RTC_INIT failed and cause system hangs

  • May 23, 2021
  • 3 replies
  • 1121 views

Hi,

When I write RTC_init() function in code which defined by stm32cube, once powerup, system goes to a hang status, after hard reset, chip works correctly... RTC clock set to LSI

when I comment RTC_init(), system works properly even, when power up and there is no need to push reset button on board...

Please help me...

This topic has been closed for replies.

3 replies

waclawek.jan
Super User
May 23, 2021

Debug as usually - single-step into that function and into functions called from there, to find where does it hang.

JW

MHaji.1Author
Senior
May 23, 2021

Thanks for reply,

The problem is, system hangs occurred once board plugged, after any reset, it works fine, or after reprogramming, it works fine.... just after power on, it stuck. how can I debug this situation?

TDK
Super User
May 23, 2021

Attach a debugger to the chip in a "hung" state without resetting the processor.

To debug your program without downloading it:

Go to Debug Configurations... -> Startup -> select load image -> Edit... -> uncheck Download

To debug without resetting the device:

Go to Debug Configurations... -> Debugger -> in Reset Behavior, select "None"

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