Skip to content

Faults before console init cause "mutex in ISR" error #11584

@kjbracey

Description

@kjbracey

Description

If the fault handler is hit before the stdio console is used and initialised, the initialisation code causes a "mutex in ISR" trap, stopping the register dump from happening. eg (in GCC, if it matters), this won't show a dump:

int *ptr;
int main()
{
    *ptr = 1;
}

This tends to hit Greentea tests, which don't use the stdio console (they use their own RawSerial).

These mutex traps are disabled by the error_in_progress flag set when mbed_error is entered, but that doesn't help with the register dump printed by the fault handler before entering mbed_error.

Possible fix might be to temporarily set the error_in_progress at the top of the fault handler, and restore it before calling mbed_error.

Issue request type

[ ] Question
[ ] Enhancement
[X] Bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions