Hello
I need to know what causes the main function to start every time, such as the first power-on, wakeup, reset, etc. Where can I get this information? What needs to be configured in DS, or which register to read?
(The chip I use is S32K312)
Thanks
Solved! Go to Solution.
Hello @Simon-Liu,
There are MC_RGM[DES], MC_RGM[FES] registers that contain the status of the destructive and functional reset sources.
In addition, on exiting a reset sequence after standby exit, the software must perform a read operation on MC_ME[PREV_MODE] and RDSS register. If any bit of the RDSS register is set, the software must ignore the status reported by MC_ME[PREV_MODE] register otherwise the status of MC_ME[PREV_MODE] register reports the device status. If MC_ME indicates last mode as RESET, then perform a reset exit in software else a standby exit.
If you use the RTD drivers, the Ip_Power driver (Power_Ip.c) has this API: Power_Ip_GetResetReason().
Regards,
Daniel
Hello @Simon-Liu,
There are MC_RGM[DES], MC_RGM[FES] registers that contain the status of the destructive and functional reset sources.
In addition, on exiting a reset sequence after standby exit, the software must perform a read operation on MC_ME[PREV_MODE] and RDSS register. If any bit of the RDSS register is set, the software must ignore the status reported by MC_ME[PREV_MODE] register otherwise the status of MC_ME[PREV_MODE] register reports the device status. If MC_ME indicates last mode as RESET, then perform a reset exit in software else a standby exit.
If you use the RTD drivers, the Ip_Power driver (Power_Ip.c) has this API: Power_Ip_GetResetReason().
Regards,
Daniel
Thank you for your answer.
I noticed that in the Power configuration of DS, there are some values in the picture below. Calling the Power_Ip_GetResetReason() interface returns these values, right?
Regards,
Simon
Yes, there is this enumeration (Power_Ip_Specific.h)
BR, Daniel
Thank you for your answer.
BestRegards,
Simon