This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMDSCNCD263P: Cannot Call TCA6424_setOutput() In FreeRTOS Idle Task or in ISR

Part Number: TMDSCNCD263P
Other Parts Discussed in Thread: TCA6424

Tool/software:

Hello,

I'm using the E2 version where OSPI reset is controlled via I2C Mux.

My application uses FreeRTOS but it seems I am unable to call TCA6424_setOutput() under two conditions:

Scenario 1

When trying to call TCA6424_setOutput() within an ISR it gets trapped by an assert here:

Scenario 2

When trying to call TCA6424_setOutput() in the FreeRTOS idle task, it gets trapped with the following message.

[Cortex_R5_0] ASSERT: 40.392078s: FreeRTOS-Kernel/tasks.c:vTaskSwitchContext:3063: (uint32_t)(uxTopPriority) failed !!!

<Q>

Under what conditions can I/can't I call TCA6424_setOutput() please?

Thank you.

  • Hi Kier,

    Im not exactly sure/have a list of do's/don'ts. Let me discuss this internally with the dev team and get back

    Regards,
    Shaunak

  • Hi Kier,

    The TCA6424_setOutput() does a semaphore pend with blocking delay. Generally, it is advised not to perform semaphore pend actions in ISR.

    The Semaphore_pend function in the dpl layer is designed in such a way to not allow semaphore pend operations in an ISR. 

    Below, I have attached the screenshot of code snippet.

    You can see that, in the else condition there is an assertion which will be executed if the function is called from an ISR.

    This would be reason why it is being stuck in an assert trap.

    If it is required to call the TCA6424_setOutput() with the occurence of an ISR, then please consider the method of posting a semaphore from the ISR and calling the function from a task.

    Regards,

    Aswin

  • Thank you very much for the explanation.