diff --git a/platform/mbed_error.c b/platform/mbed_error.c index 9c38322773..97134e232c 100644 --- a/platform/mbed_error.c +++ b/platform/mbed_error.c @@ -25,6 +25,7 @@ #include "platform/mbed_error_hist.h" #include "platform/mbed_interface.h" #include "platform/mbed_power_mgmt.h" +#include "platform/mbed_stats.h" #ifdef MBED_CONF_RTOS_PRESENT #include "rtx_os.h" #endif @@ -454,6 +455,8 @@ static void print_threads_info(const osRtxThread_t *threads) #endif #ifndef NDEBUG +#define GET_TARGET_NAME_STR(tgt_name) #tgt_name +#define GET_TARGET_NAME(tgt_name) GET_TARGET_NAME_STR(tgt_name) static void print_error_report(const mbed_error_ctx *ctx, const char *error_msg, const char *error_filename, int error_line) { 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, mbed_error_printf("\nDelay:"); print_threads_info(osRtxInfo.thread.delay_list); #endif - mbed_error_printf(MBED_CONF_PLATFORM_ERROR_DECODE_HTTP_URL_STR, ctx->error_status); +#if !defined(MBED_SYS_STATS_ENABLED) + mbed_error_printf("\nFor more info, visit: https://mbed.com/s/error?error=0x%08X&tgt=" GET_TARGET_NAME(TARGET_NAME), ctx->error_status); +#else + mbed_stats_sys_t sys_stats; + mbed_stats_sys_get(&sys_stats); + 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); +#endif mbed_error_printf("\n-- MbedOS Error Info --\n"); } #endif //ifndef NDEBUG + #if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED //Retrieve the error context from error log at the specified index mbed_error_status_t mbed_get_error_hist_info(int index, mbed_error_ctx *error_info) diff --git a/platform/mbed_lib.json b/platform/mbed_lib.json index 247a41a7ae..30adfba7c9 100644 --- a/platform/mbed_lib.json +++ b/platform/mbed_lib.json @@ -108,11 +108,6 @@ "value": null }, - "error-decode-http-url-str": { - "help": "HTTP URL string for ARM Mbed-OS Error Decode microsite", - "value": "\"\\nFor more info, visit: https://armmbed.github.io/mbedos-error/?error=0x%08X\"" - }, - "cthunk_count_max": { "help": "The maximum CThunk objects used at the same time. This must be greater than 0 and less 256", "value": 8 diff --git a/tools/toolchains/__init__.py b/tools/toolchains/__init__.py index 106fba98f7..8051de8018 100644 --- a/tools/toolchains/__init__.py +++ b/tools/toolchains/__init__.py @@ -191,7 +191,7 @@ class mbedToolchain: labels = self.get_labels() self.cxx_symbols = ["TARGET_%s" % t for t in labels['TARGET']] self.cxx_symbols.extend(["TOOLCHAIN_%s" % t for t in labels['TOOLCHAIN']]) - + # Cortex CPU symbols if self.target.core in mbedToolchain.CORTEX_SYMBOLS: self.cxx_symbols.extend(mbedToolchain.CORTEX_SYMBOLS[self.target.core]) @@ -201,6 +201,8 @@ class mbedToolchain: if MBED_ORG_USER: self.cxx_symbols.append('MBED_USERNAME=' + MBED_ORG_USER) + # Add target's name + self.cxx_symbols += ["TARGET_NAME=" + self.target.name] # Add target's symbols self.cxx_symbols += self.target.macros # Add target's hardware