I am trying to implement a more comprehensive reset reason handler for my new P2 based product.
Having implemented a basic handler to see what results I get I have some questions:
RESET_REASON_NONE - never seen this, when might this occur and how best to handle it?
RESET_REASON_UNKNOWN - ditto above
RESET_REASON_PIN_RESET - was expecting to see this if I press the reset button or the hardware watchdog does the same but instead I get RESET_REASON_POWER_DOWN
RESET_REASON_POWER_MANAGEMENT - never seen this, can I assume not relevant to P2?
RESET_REASON_POWER_DOWN - seen this and also after USB flash restart - does that make sense?
RESET_REASON_POWER_BROWNOUT - I have seen post by Gus - not relevant to P2
RESET_REASON_WATCHDOG - not seen this but assume this is from software watchdog?
RESET_REASON_UPDATE - with OTA flash and USB. Any examples of possible ways to handle/use this? I have seen subsequent restarts after flash retain this reason - causes?
RESET_REASON_UPDATE_TIMEOUT - only with OTA flash not USB? Any examples of ways to use this please?
RESET_REASON_FACTORY_RESET - never seen this, when might this occur and how best to handle it?
RESET_REASON_SAFE_MODE - seen this after System.enterSafeMode() has been called
RESET_REASON_DFU_MODE - is this called when buttons used to enter DFU mode or just System.dfu()?
RESET_REASON_PANIC - I am calling System.enterSafeMode(RESET_NO_WAIT) so that there device could be recovered with an OTA update? Is there anything more that could be done?
RESET_REASON_USER - Application called System.reset() or System.reset(resetReasonData)
I appreciate this is a long list, maybe a useful basis for the reference documents to be enhanced.