Hi,
Now I'm working on KS22xxxx. There is a problem that when I was initializing the RTC module through writing or reading the register of it, the processor would report a HARDWARE FAULT. I'm wondering what I have done have any issues.
Following is my code.
rtc_datetime_t mrtc_datetime_t;
rtc_config_t mrtc_config_t;
memset(&mrtc_datetime_t,0,sizeof(rtc_datetime_t));
RTC_GetDefaultConfig(&mrtc_config);
RTC_Init(RTC,&mrtc_config_t);
RTC_StartTimer(RTC);
Hi
Before accessing RTC register you need to enable the RTC clock kin SIM_SCGC6. If not, you will have a hard fault.
In addition, VBAT needs to be connected!
Regards
Mark