Skip to content

Commit ffa8941

Browse files
committed
Crash dump : force data to be written in RAM
Due to ECC cache mechanism, the last data is not guarantee to be written in RAM before a system reset. With this modification, we ensure that the crc is well written. Fiw #11422 Signed-off-by: Vincent Veron <[email protected]>
1 parent 82e89ad commit ffa8941

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

platform/mbed_error.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ typedef struct _mbed_error_ctx {
849849
int32_t is_error_processed;//once this error is processed set this value to 1
850850
uint32_t crc_error_ctx;//crc_error_ctx should always be the last member in this struct
851851
#endif
852+
uint64_t dummy; // dummy to force data to be written in RAM
852853
} mbed_error_ctx;
853854

854855
/** To generate a fatal compile-time error, you can use the pre-processor #error directive.

platform/source/mbed_error.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ WEAK MBED_NORETURN mbed_error_status_t mbed_error(mbed_error_status_t error_stat
336336
core_util_critical_section_enter();
337337
memcpy(report_error_ctx, &last_error_ctx, sizeof(mbed_error_ctx));
338338
core_util_critical_section_exit();
339+
339340
//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
340341
#if MBED_CONF_PLATFORM_FATAL_ERROR_AUTO_REBOOT_ENABLED && (MBED_CONF_PLATFORM_ERROR_REBOOT_MAX > 0)
341342
#ifndef NDEBUG

0 commit comments

Comments
 (0)