Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make print_error_report available outside of mbed_error.c #8471

Closed
LaurentLouf opened this issue Oct 18, 2018 · 2 comments
Closed

Make print_error_report available outside of mbed_error.c #8471

LaurentLouf opened this issue Oct 18, 2018 · 2 comments

Comments

@LaurentLouf
Copy link
Contributor

LaurentLouf commented Oct 18, 2018

Description

I don't think this is linked to any target in particular, but it would be nice to define print_error_report as a normal function instead of a static function, to be able to use it anywhere in the code. I don't know how common this may be, but one possible use case is the following : I implement a custom error handling code, where I save errors (the error context to be precise) in the internal flash of the target or on any storage and restart the system instead of halting it. When booting next time, I will inspect the storage to see if any error occurred and it would be nice to have the same formatting than the formatting used by print_error_report for consistency, so it would be nice if this function was available everywhere. Some info may be garbage, but most of it should be pretty useful.

Issue request type

[ ] Question
[x] Enhancement
[ ] Bug

@ciarmcom
Copy link
Member

Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-22

@SenRamakri
Copy link
Contributor

Hi @LaurentLouf , Thanks for your suggestion. I have analyzed your request and I think, as print_error_report() report is specifically written for Mbed-OS error handling+error coding, exposing it outside will open up opportunities to bypass the overall error handing APIs provided by Mbed-OS which is not expected. What I suggest is if you want to capture specific error scenarios, define custom error codes in mbed_error.h. For now, Im closing this as no action is required.
Also with upcoming Mbed-OS release 5.12 happening in next few weeks we will introducing the Crash-reporting feature which will capture the error scenario in RAM and warm-reset the system which you are currently doing with internal flash - See https://github.com/ARMmbed/mbed-os/blob/master/docs/design-documents/platform/crash-reporting/crash_reporting.md for more info on that. Its already part of master branch though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants