Skip to content

Commit d0b9503

Browse files
committed
Print crash report reboot messages only for non-release builds
1 parent 815066f commit d0b9503

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

platform/mbed_error.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,13 @@ WEAK MBED_NORETURN mbed_error_status_t mbed_error(mbed_error_status_t error_stat
292292
core_util_critical_section_exit();
293293
//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
294294
#if MBED_CONF_PLATFORM_FATAL_ERROR_AUTO_REBOOT_ENABLED && (MBED_CONF_PLATFORM_ERROR_REBOOT_MAX > 0)
295+
#ifndef NDEBUG
295296
mbed_error_printf("\n= System will be rebooted due to a fatal error =\n");
296297
if (report_error_ctx->error_reboot_count >= MBED_CONF_PLATFORM_ERROR_REBOOT_MAX) {
297298
//We have rebooted more than enough, hold the system here.
298299
mbed_error_printf("= Reboot count(=%ld) reached maximum, system will halt after rebooting =\n", report_error_ctx->error_reboot_count);
299300
}
301+
#endif
300302
system_reset();//do a system reset to get the system rebooted
301303
#endif
302304
#endif

0 commit comments

Comments
 (0)