2021-10-31 02:55 PM
Hi all,
I am working with a Nucleo STM32L452RE board and I had a bit of trouble enabling the RTC clock. I am just trying to get a scope shot of the waveform output by the clock itself and I noticed it was not on by default. I attempted to use a few example programs supplied by the IAR Embedded Workbench - specifically the RTC Alarm program. I keep getting stuck inside of an initialization error on line 206 of main.c and the RTC clock never starts up. Any thoughts on this? I've included the c files for the program below in case anyone is not familiar or cannot find it.
Thanks in advance for all your help!
2021-10-31 05:22 PM
> RCC_OscInitStruct.HSEState = RCC_HSE_ON;
The Nucleo board gets its clock source from the onboard ST-Link by default. It doesn't use a crystal, so the HSE should be set to bypass mode:
RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;
This has nothing to do with the RTC, but it is the reason your program is stuck on line 206.
2021-11-01 02:56 PM
.
2021-11-01 02:56 PM
Thanks so much! I changed that line and I still error.
I changed the example I was using to the RTC_LSI example but I still hang on the same line. Is that all I should need to change to use a nucleo board with this example? My problem lies entirely in the SystemClock_Config() function.