|
25 | 25 | #include "platform/mbed_error_hist.h"
|
26 | 26 | #include "platform/mbed_interface.h"
|
27 | 27 | #include "platform/mbed_power_mgmt.h"
|
| 28 | +#include "platform/mbed_stats.h" |
28 | 29 | #ifdef MBED_CONF_RTOS_PRESENT
|
29 | 30 | #include "rtx_os.h"
|
30 | 31 | #endif
|
@@ -454,6 +455,8 @@ static void print_threads_info(const osRtxThread_t *threads)
|
454 | 455 | #endif
|
455 | 456 |
|
456 | 457 | #ifndef NDEBUG
|
| 458 | +#define GET_TARGET_NAME_STR(tgt_name) #tgt_name |
| 459 | +#define GET_TARGET_NAME(tgt_name) GET_TARGET_NAME_STR(tgt_name) |
457 | 460 | static void print_error_report(const mbed_error_ctx *ctx, const char *error_msg, const char *error_filename, int error_line)
|
458 | 461 | {
|
459 | 462 | int error_code = MBED_GET_ERROR_CODE(ctx->error_status);
|
@@ -539,11 +542,18 @@ static void print_error_report(const mbed_error_ctx *ctx, const char *error_msg,
|
539 | 542 | mbed_error_printf("\nDelay:");
|
540 | 543 | print_threads_info(osRtxInfo.thread.delay_list);
|
541 | 544 | #endif
|
542 |
| - mbed_error_printf(MBED_CONF_PLATFORM_ERROR_DECODE_HTTP_URL_STR, ctx->error_status); |
| 545 | +#if !defined(MBED_SYS_STATS_ENABLED) |
| 546 | + mbed_error_printf("\nFor more info, visit: https://mbed.com/s/error?error=0x%08X&tgt=" GET_TARGET_NAME(TARGET_NAME), ctx->error_status); |
| 547 | +#else |
| 548 | + mbed_stats_sys_t sys_stats; |
| 549 | + mbed_stats_sys_get(&sys_stats); |
| 550 | + mbed_error_printf("\nFor more info, visit: https://mbed.com/s/error?error=0x%08X&osver=%d&core=0x%08X&comp=%d&ver=%d&tgt=" GET_TARGET_NAME(TARGET_NAME), ctx->error_status, sys_stats.os_version, sys_stats.cpu_id, sys_stats.compiler_id, sys_stats.compiler_version); |
| 551 | +#endif |
543 | 552 | mbed_error_printf("\n-- MbedOS Error Info --\n");
|
544 | 553 | }
|
545 | 554 | #endif //ifndef NDEBUG
|
546 | 555 |
|
| 556 | + |
547 | 557 | #if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED
|
548 | 558 | //Retrieve the error context from error log at the specified index
|
549 | 559 | mbed_error_status_t mbed_get_error_hist_info(int index, mbed_error_ctx *error_info)
|
|
0 commit comments