Skip to content

Halt to enforce reboot limit once only #9544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions platform/mbed_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,16 @@ mbed_error_status_t mbed_error_initialize(void)
//We let the callback reset the error info, so check if its still valid and do the rest only if its still valid.
if (report_error_ctx->error_reboot_count > 0) {

report_error_ctx->is_error_processed = 1;//Set the flag that we already processed this error
crc_val = compute_crc32(report_error_ctx, offsetof(mbed_error_ctx, crc_error_ctx));
report_error_ctx->crc_error_ctx = crc_val;

//Enforce max-reboot only if auto reboot is enabled
#if MBED_CONF_PLATFORM_FATAL_ERROR_AUTO_REBOOT_ENABLED
if (report_error_ctx->error_reboot_count >= MBED_CONF_PLATFORM_ERROR_REBOOT_MAX) {
mbed_halt_system();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we clear all RAM data here before halting? So next reset - which has to be manual since system is in halt will not have impact of this error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we probably want to preserve the contents of the error RAM, in case someone wants to attach a debugger or something. Setting the "processed" flag should be sufficient to stop anything else happening on next reset.

}
#endif
report_error_ctx->is_error_processed = 1;//Set the flag that we already processed this error
crc_val = compute_crc32(report_error_ctx, offsetof(mbed_error_ctx, crc_error_ctx));
report_error_ctx->crc_error_ctx = crc_val;
}
}
}
Expand Down