Skip to content

Commit

Permalink
[misc] enable crash dump logging if ot_crash_handler component is p…
Browse files Browse the repository at this point in the history
…resent
  • Loading branch information
lmnotran committed Feb 27, 2024
1 parent b92738b commit 3aefd09
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/platform_projects/openthread-efr32-rcp-spi.slcp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ category: OpenThread Examples
quality: production

component:
- id: ot_crash_handler
- id: ot_platform_abstraction_core
- id: ot_mbedtls
- id: ot_stack_features_config
Expand Down
1 change: 1 addition & 0 deletions src/platform_projects/openthread-efr32-rcp-uart.slcp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ category: OpenThread Examples
quality: production

component:
- id: ot_crash_handler
- id: ot_platform_abstraction_core
- id: ot_mbedtls
- id: ot_stack_features_config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ category: OpenThread Examples
quality: production

component:
- id: ot_crash_handler
- id: ot_platform_abstraction_core
- id: ot_psa_crypto
- id: ot_mbedtls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ category: OpenThread Examples
quality: production

component:
- id: ot_crash_handler
- id: ot_platform_abstraction_core
- id: ot_psa_crypto
- id: ot_mbedtls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ category: OpenThread Examples
quality: production

component:
- id: ot_crash_handler
- id: ot_platform_abstraction_core
- id: ot_psa_crypto
- id: ot_mbedtls
Expand Down
1 change: 1 addition & 0 deletions src/platform_projects/openthread-efr32-soc.slcp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ category: OpenThread Examples
quality: production

component:
- id: ot_crash_handler
- id: ot_platform_abstraction_core
- id: ot_psa_crypto
- id: ot_mbedtls
Expand Down
6 changes: 6 additions & 0 deletions src/src/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,9 @@ otError railStatusToOtError(RAIL_Status_t status)
return OT_ERROR_FAILED;
}
}

otError otPlatLogCrashDump(void)
{
efr32PrintResetInfo();
return OT_ERROR_NONE;
}
18 changes: 18 additions & 0 deletions src/src/openthread-core-efr32-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
#ifndef OPENTHREAD_CORE_EFR32_CONFIG_H_
#define OPENTHREAD_CORE_EFR32_CONFIG_H_

#ifdef SL_COMPONENT_CATALOG_PRESENT
#include "sl_component_catalog.h"
#endif // SL_COMPONENT_CATALOG_PRESENT

#include "sl_device_init_hfxo.h"
#include "sl_device_init_hfxo_config.h"

Expand Down Expand Up @@ -556,4 +560,18 @@
#define SL_OPENTHREAD_ECDSA_PRIVATE_KEY_SIZE 32
#endif

/**
* @def OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE
*
* Enable logging a crash dump on RCPs
*
*/
#ifndef OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE
#if defined(SL_CATALOG_OT_CRASH_HANDLER_PRESENT)
#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 1
#else
#define OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE 0
#endif
#endif

#endif // OPENTHREAD_CORE_EFR32_CONFIG_H_

0 comments on commit 3aefd09

Please sign in to comment.