diff --git a/platform/mbed_error.h b/platform/mbed_error.h index 9ba86b279a7..db4f49063d9 100644 --- a/platform/mbed_error.h +++ b/platform/mbed_error.h @@ -849,6 +849,7 @@ typedef struct _mbed_error_ctx { int32_t is_error_processed;//once this error is processed set this value to 1 uint32_t crc_error_ctx;//crc_error_ctx should always be the last member in this struct #endif + uint64_t dummy; // dummy to force data to be written in RAM } mbed_error_ctx; /** To generate a fatal compile-time error, you can use the pre-processor #error directive. diff --git a/platform/source/mbed_error.c b/platform/source/mbed_error.c index bc16a3d8ed9..9b61468c263 100644 --- a/platform/source/mbed_error.c +++ b/platform/source/mbed_error.c @@ -336,6 +336,7 @@ WEAK MBED_NORETURN mbed_error_status_t mbed_error(mbed_error_status_t error_stat core_util_critical_section_enter(); memcpy(report_error_ctx, &last_error_ctx, sizeof(mbed_error_ctx)); core_util_critical_section_exit(); + //We need not call delete_mbed_crc(crc_obj) here as we are going to reset the system anyway, and calling delete while handling a fatal error may cause nested exception #if MBED_CONF_PLATFORM_FATAL_ERROR_AUTO_REBOOT_ENABLED && (MBED_CONF_PLATFORM_ERROR_REBOOT_MAX > 0) #ifndef NDEBUG