Thank you Kerry Zhou for replying. Downloaded KSDK 2.3 but no luck.
I noticed one thing. Whenever I try to perform any operation (whether it is read or write) on RTC registers hard fault occurs. So basically clock enable using
SIM_SCGC6 |= SIM_SCGC6_RTC_MASK;
doesn't give any error. But as soon as I try to read/write a register hard fault occur be it software reset on RTC_CR ( RTC_CR |= RTC_CR_SWR_MASK; ) or trying to disable time counter in RTC_SR ( RTC_SR &= ~RTC_SR_TCE_MASK; ).
Now I have few doubts on hardware part:
1. Do I have to always keep the battery connected?
2. Do I need to use external capacitors and resistor while using 32.768KHz crystal oscillator?
One more thing, the default values of the registers associated to RTC are not same as described in the reference manual.
Thank you.