mirror of
https://github.com/espressif/openthread.git
synced 2026-09-14 05:00:11 +00:00
[spinel] add support for logging crash dumps (#10061)
This commit adds a new feature that allows platforms to log crash logs.
### Additions
- `void otPlatLogCrashDump(void)` - API that logs a crash dump using
OpenThread Logging APIs
- `SPINEL_PROP_RCP_LOG_CRASH_DUMP` - spinel prop that calls
`otPlatLogCrashDump()` when `Set`
- `SPINEL_CAP_RCP_LOG_CRASH_DUMP` - spinel capability denoting that a
RCP supports logging crash dumps
### Usage
- For `ot-cli-ftd|mtd`, `otPlatLogCrashDump()` is called at the end of
app initialization, before the main loop. See [main.c]
- For Host/RCP setups, during initialization, the Host gets the RCP
capabilities. If the RCP has the `SPINEL_CAP_RCP_LOG_CRASH_DUMP`
capability, the Host will `Set` the `SPINEL_PROP_RCP_LOG_CRASH_DUMP`
property, triggering the RCP to call `otPlatLogCrashDump()`.
- If RCP Recovery is enabled, the this will also happen once the RCP
has been restored
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
#include <openthread/diag.h>
|
||||
#include <openthread/tasklet.h>
|
||||
#include <openthread/platform/logging.h>
|
||||
#include <openthread/platform/misc.h>
|
||||
|
||||
#include "openthread-system.h"
|
||||
#include "cli/cli_config.h"
|
||||
@@ -140,6 +141,10 @@ pseudo_reset:
|
||||
IgnoreError(otCliSetUserCommands(kCommands, OT_ARRAY_LENGTH(kCommands), instance));
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE
|
||||
otPlatLogCrashDump();
|
||||
#endif
|
||||
|
||||
while (!otSysPseudoResetWasRequested())
|
||||
{
|
||||
otTaskletsProcess(instance);
|
||||
|
||||
Reference in New Issue
Block a user