Skip to content

Commit 5ad20d4

Browse files
author
Cruz Monrreal
authored
Merge pull request #9164 from SenRamakri/sen_MemFixCrashReportPrint
Disable printf in crash reporting for release builds
2 parents 198a8bf + daa8b0e commit 5ad20d4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

platform/mbed_error.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ mbed_error_status_t mbed_error_initialize(void)
211211
if ((report_error_ctx->crc_error_ctx == crc_val) && (report_error_ctx->is_error_processed == 0)) {
212212
is_reboot_error_valid = true;
213213
//Report the error info
214+
#ifndef NDEBUG
214215
printf("\n== The system has been rebooted due to a fatal error. ==\n");
216+
#endif
215217

216218
//Call the mbed_error_reboot_callback, this enables applications to do some handling before we do the handling
217219
mbed_error_reboot_callback(report_error_ctx);
@@ -223,7 +225,9 @@ mbed_error_status_t mbed_error_initialize(void)
223225
#if MBED_CONF_PLATFORM_FATAL_ERROR_AUTO_REBOOT_ENABLED
224226
if (report_error_ctx->error_reboot_count >= MBED_CONF_PLATFORM_ERROR_REBOOT_MAX) {
225227
//We have rebooted more than enough, hold the system here.
228+
#ifndef NDEBUG
226229
printf("\n== Reboot count(=%ld) exceeded maximum, system halting ==\n", report_error_ctx->error_reboot_count);
230+
#endif
227231
mbed_halt_system();
228232
}
229233
#endif

0 commit comments

Comments
 (0)