Hi, I am using MK64FN1M0VLL12 processor and working on RTC. But in the first line itself getting a hard fault. I tried to solve it but failed. can anyone help to solve this problem. External 32.768KHz crystal, Battery connected. Open to any suggestion.
This my initialization code. Thank you.
volatile uint32_t i;
SIM->SCGC6 |= SIM_SCGC6_RTC_MASK;
RTC->SR &= ~RTC_SR_TCE_MASK;
RTC->CR &= ~RTC_CR_OSCE_MASK;
RTC->CR |= RTC_CR_OSCE_MASK;
RTC->SR |= RTC_SR_TCE_MASK;