[spinel] abort host after receiving unexpected reset from RCP (#8909)

Some platforms, such as Android and CastOS, can monitor program crash.
And they can upload the crash dump to the crash server for developers
to analyze the crash reason.

This commit aborts the host after receiving a unexpected reset to
trigger platforms to upload the crash dump.
This commit is contained in:
Zhanglong Xia
2023-03-27 23:03:26 -07:00
committed by GitHub
parent 4b97fd7e46
commit 7bdcf8a5d4
2 changed files with 11 additions and 0 deletions
@@ -55,4 +55,13 @@
#define OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT 0
#endif
/**
* @def OPENTHREAD_SPINEL_CONFIG_ABORT_ON_UNEXPECTED_RCP_RESET_ENABLE
*
* Define 1 to abort the host when receiving unexpected reset from RCP.
*
*/
#ifndef OPENTHREAD_SPINEL_CONFIG_ABORT_ON_UNEXPECTED_RCP_RESET_ENABLE
#define OPENTHREAD_SPINEL_CONFIG_ABORT_ON_UNEXPECTED_RCP_RESET_ENABLE 0
#endif
#endif // OPENTHREAD_SPINEL_CONFIG_H_
+2
View File
@@ -2259,6 +2259,8 @@ void RadioSpinel<InterfaceType, ProcessContextType>::HandleRcpUnexpectedReset(sp
#if OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT > 0
mRcpFailed = true;
#elif OPENTHREAD_SPINEL_CONFIG_ABORT_ON_UNEXPECTED_RCP_RESET_ENABLE
abort();
#else
DieNow(OT_EXIT_RADIO_SPINEL_RESET);
#endif