Added functions to setup RTC timer, store stack cache state in interrupt handler