mirror of
https://github.com/espressif/openthread.git
synced 2026-08-13 22:27:47 +00:00
[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:
@@ -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_
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user