Hi Alexis,
Thanks for your reply!
I was able to make the code work by modifying the code a bit. I modified the ISR to occur at 1 second interval and updated a32-bit counter.
In "import SDK example", I selected the FRDM-KE06 and later, I modified the MCU to MKE04z128xxx4. This way, I was able to debug it on my MKE04z128xxx4 custom board.
I am also able to select MKE04z128xxx4 in the "New project" option and debug my own code which uses the SDK files.
As I am using MCUXpresso 10.2 and SDK v2.4, it might be a bit different from MCU 10.1 and SDK 2.3
I had another query. I wanted to know how use the RTC on this MCU in low power mode.
I want to put the MCU to STOP mode whenever the mains supply is removed. I will check the supply voltage on an ADC pin and as soon as it becomes 0, I will put the MCU in STOP mode. I will also connect an external battery circuitry to the Vdd pin so that LPO keeps working.
I will use the __asm(“WFI”) instruction to go into STOP mode.
In the STOP mode the LPO will be working but the ISR, where the 32-bit counter is updated, won’t be executed. In such a case, how I can calculate the correct time after the mains supply is supplied again and I enter the RUN mode.