ArduinoCore-mbed icon indicating copy to clipboard operation
ArduinoCore-mbed copied to clipboard

Accessing mbed errors history

Open Goliath86 opened this issue 1 year ago • 1 comments

Hi, how can I access the functions mbed_get_error_hist_count() and mbed_get_error_hist_info()? I can't compile if I use it

This is the function I use to try to get the errors history:

void getErrorInfoFromHist() { mbed_error_ctx hist_error_ctx; int numEntriesInHist = mbed_get_error_hist_count(); for (int i = 0; i < numEntriesInHist; i++) { mbed_get_error_hist_info(i, &hist_error_ctx); printf(MBED_GET_ERROR_CODE(hist_error_ctx.error_status)); } mbed_clear_all_errors(); }

But when I compile I get:

undefined reference to mbed_get_error_hist_count undefined reference to mbed_get_error_hist_info

Thank you

Goliath86 avatar Jun 27 '24 13:06 Goliath86

Hi @Goliath86 this two functions are not enabled by default if you need to use them you have to rebuild libmbed.a and enable MBED_CONF_PLATFORM_ERROR_HIST_ENABLED

pennam avatar Jun 27 '24 13:06 pennam