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.

TMS570LC4357: Index of currently active ISR

Part Number: TMS570LC4357

Hi,

I'm looking for a solution or a way to get an index of currently running ISR - as far as i've checked this is not possible using ISRINDEX or FIQINDEX registers because they might get overriden when active ISR is getting handled.

Is there any solution for it?

Best,

Grzegorz

  • Hi,

    When an interrupt is serviced, the offset vectors (ISRINDEX and FIQINDEX) show the index for the next highest pending interrupt or 0x0 if no interrupt is pending. You can print the interrupt info in the interrupt ISR. 

  • Hi,

    How do we check an index of currently serviced interrupt?

  • The ISR knows it's index number in VIM table. For example, GIO high level interrupt is on VIM channel #9. 

  • I need more generic way to find out the index of currently serviced interrupt - this is needed for segger systemview API where there is a single call for any interrupt which should tell the segger api which interrupt is currently active so it can be logged.

    So i need to have an a generic way(function) that can be called in any ISR that will tell me what interrupt i'm currently in. Is this possible in this MCU?

  • Bumping thread, as I'm still looking for a solution.

  • The ISRINDEX is cleared after reading the module's interrupt offset register or writing to flag register, for example gioREG->OFF1, canREG1->INT, and rtiREG1->INTFLAG. 

    You can read  ISRINDEX register before reading the module's interrupt offset register. 

    void gioHighLevelInterrupt(void)
    {

               uint32 index = vimREG->IRQINDEX;


               uint32 offset = gioREG->OFF1;

  • It is still not what i'm looking for.

    As you have mentioned ISRINDEX reports index of a highest pending interrupt and i would like to know inside current ISR routine in which ISR i am.

    Example:

    void lowPrioIsr(void) {

       //HighPrioIsr is pending

       int isrIndex = WhereIAm(); // reports LowPrioIsr

    }

    void HighPrioIsr (void) {

       int isrIndex = WhereIAm(); //reports HighPrioIsr index

    }

  • Hi,

    Another way is to get the index of the VIM vector table manually:

    typedef enum _INT_Index
    {
          ESM_High =0,

          RSVED1,

          RTI_COMP0,    //2

          RTI_COMP1,    //3

           ,...

           GIO_High,       //9

            ...

    } intIndex_t;

    #pragma CODE_STATE(gioHighLevelInterrupt, 32)
    #pragma INTERRUPT(gioHighLevelInterrupt, IRQ)

    /* SourceId : GIO_SourceId_011 */
    /* DesignId : GIO_DesignId_011 */
    /* Requirements : HL_SR35, HL_SR36 */
    void gioHighLevelInterrupt(void)
    {
         uint32 offset = gioREG->OFF1;

         /* USER CODE BEGIN (14) */

        intIndex_t interrupt_index = GIO_HIGH;


         /* USER CODE END */

  • This won't solve our issue too.

    We need to get ISR index through one callback function so manual getting is no go. It seems like there is no solution for that in this processor.