Hi Kirti,
Could you let me know if you're using KSDK and the version?
Are you using a custom bootloader or the MCUBoot?
Also, as an error catch, you could check the register RCM_SRS1, this will help you know the reset source. The SW bit should help you to know if the MCU comes from a software reset.
Best Regards,
Alexis Andalon