Page 1 of 1

STM32G47x hangs up after cold reset

Posted: Wed Sep 16, 2020 2:37 pm
by alexblack
Hi.
After last update of the ChbiOS the STM32G474 start to hangs up after cold start. If I press reset - the CPU restarted and worked well. On the previous commit it works fine in any case.

After some experiments I was found that the problem is with RTC and LSE, because If I set the option HAL_USE_RTC to FALSE - all works, or if I set the option STM32_RTCSEL to STM32_RTCSEL_LSI - it is also works.

I was sow that the function stm32_clock_init() was changed. Now LSE inited first, in previous commit it inited just before PLL init. I tried move this init just before PLL init and the problem dissapears. Also it seems that the hang is in function rtc_enter_init() in file hal_rtc_lld.c

Re: STM32G47x hangs up after cold reset

Posted: Wed Sep 16, 2020 2:44 pm
by Giovanni
HI,

I will look into it, the clock initialization has been reworked but I have not tried yet all the options. Moving in bug reports.

Giovanni

Re: STM32G47x hangs up after cold reset

Posted: Sat Sep 19, 2020 11:23 am
by Giovanni
Hi,

The problem was that the BD was reset after LSE initialization so LSE was turned off again before RTC initialization, fixed in repository.

Thanks for finding.

Giovanni