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.

TMS320F2800137: Is it possible to know if a function is called in interrupt context

Part Number: TMS320F2800137

Tool/software:

Hi all, quick question.

Is it possible on a C28x processor to check if a function is called from ISR context? In CMSIS you have __get_IPSR() which you can use to detect it. Is there something like it for the C28x?

Thanks!

  • Hi,

    I don't think we have a direct way to check this but I'll check with our design expert and get back to you.

    User can have their own global flag which they can set inside ISR and check that flag value inside the function to know if function was call inside ISR or outside. 

    Regards,

    Vivek Singh

  • Hi Vivek,

    Thanks for your reply. Did you manage to check this with a design expert?

    A flag is possible, but i don't like the implementation. It seems like a workaround and is highly error prone if a developer forgets to implement this flag.

    There are many interrupt registers in the C28x device, and i'm unable to find a register which holds a bit for unhandled interrupts.

    When an interrupt triggers, it has to be cleared by calling Interrupt_clearACKGroup, right? This function writes to the PIECTRL_BASE + PIE_O_ACK register. What does this clear? Can this register be leveraged to check if a a function is called within ISR context?

  • Hi,

    There is no direct way to check this. PIEACK gets set as along as interrupt gets generated from PIE but that does not mean that CPU ISR getting executed. Please see below diagram for this -

    Regards,

    Vivek Singh