Skip to content

detachInterrupt() from within ISR (freeRTOS) runs into Mutex #1441

Closed
@caveman99

Description

@caveman99

We are using Radiolib in Meshtastic. While porting the existing code (that runs fine on ESP32* an nRF52) to RP2040 we're running into a mutex deadlock when calling detachInterrupt through the Radiolib clearDio1Action() from a running ISR. This seems to be a similar issue as #878

There is more comments and a debug trace in meshtastic/firmware#2299

The calling code is as simple as

void INTERRUPT_ATTR RadioLibInterface::isrLevel0Common(PendingISR cause)
{
    instance->disableInterrupt(); // this calls lora.clearDio1Action()

    BaseType_t xHigherPriorityTaskWoken;
    instance->notifyFromISR(&xHigherPriorityTaskWoken, cause, true);

    /* Force a context switch if xHigherPriorityTaskWoken is now set to pdTRUE.
    The macro used to do this is dependent on the port and may be called
    portEND_SWITCHING_ISR. */
    YIELD_FROM_ISR(xHigherPriorityTaskWoken);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions