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.

How to make reentrance of RTI for RM57L843?

Other Parts Discussed in Thread: RM57L843

Dear TI.

I have made a RTI using RM57L843 MCU.

And try reentrant while interrupt servicing.

But new event of RTI does not create while RTI servicing.

I had tested FIQ option of RTI. But it was also not work.

Can anyone give me the the solution?

Thanks in advance.

Best regards.

Sunny

I can manage maximun reentrancing count. So I can use my program within fixed interrupt stack.

  • Hi Sunny,

      Are you trying to use nested interrupts? See ARM TRM in section 2.8.3 Interrupts for more details. Below is the excerpt.

    "IRQ interrupts are automatically disabled when an IRQ occurs, by setting the CPSR.I bit. You can use nested interrupts but it is up to you to save any corruptible registers and to re-enable IRQs by clearing the CPSR.I bit."

    "FIQ and IRQ interrupts are automatically masked by setting the CPSR.F and CPSR.I bits when an FIQ occurs. You can use nested interrupts but it is up to you to save any corruptible registers and to re-enable interrupts."

     Also read section 2.7.9 The I and F bits to enable or disable the IRQ/FIQ interrupts.

  • Hi Charles,

    Thank you for your information.

    Yes, I am trying to use nested interrupt.

    I found ARM TRM at http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0460d/index.html.

    And I have read your information. And then I have made my testing program as the follows.

    void rtiNotification(rtiBASE_t *rtiREG, uint32 notification)
    {
     uint32 i;
    /*  enter user code between the USER CODE BEGIN and USER CODE END. */
     _enable_IRQ_interrupt_();
     for(i=0;i<MAX_Task;i++) {
      if((uint32)(Task[i].funcPtr)==(uint32)0)
       continue;
      if( TaskFlag & usaBitData[i] )
       return;
      //-----------------------------------------------------------------------
      SET_TaskFlag(usaBitData[i]);
      Print("T%c",i+0x30);
      Task[i].funcPtr();

      RESET_TaskFlag(usaBitData[i]);
      //=======================================================================
     }
    }

    But I cannot succed my wanted.

    When I repeat STOP and Restart, sometime it's working, but sometimes it's not working.

    The case of my wanted.

    T5(4999)
    T6------(9999)
    T5(5000)
    T7------------(19999)
    T5(5000)
    T6------(10000)
    T5(5000)
    T5(4999)
    T6------(9999)
    T5(5000)
    T7------------(20000)
    T5(5000)
    T6------(10000)
    T5(5000)
    T5(4999)
    T6------(9999)
    T5(5000)
    T7------------(19999)
    T5(5000)
    T6------(10000)
    T5(5000)
    T5(4999)
    T6------(9999)
    T5(5000)
    T7------------(20000)
    T5(5000)

    The case of the wrong.

    executed InitMainISR()
    T5(22065)
    T6------(22066)
    T5(5000)
    T7------------(22066)
    T5(4999)
    T6------(9999)
    T5(4999)
    T5(4999)
    T6------(9999)
    T5(5000)
    T5(4999)
    T5(4999)
    T5(5000)
    T5(5000)
    T5(89)
    T6------(1109)
    T7------------(7129)

    <<Here was STOP without reason.>>

    <<I restart program at CCS manually>>
    executed InitMainISR()
    T5(22065)
    T6------(22066)
    T5(5000)
    T7------------(22066)
    T5(4999)

    <<Here was STOP again without reason.>>

    My testing environment:

       - TMDXRM57LHDK

       - HalGoGen: 04.01.00

       - CCS: 6.0.1.00040

    I have a question.

    1. Do I have to push and pop Instruction Point and all registers by myself?

    2. Could you help me how I can do?

    Thanks in advance.

    Best regards.

    Sunny.

  • Hello Sunny,

      I find several past posts which might be of help to you regarding nested interrupts. You can also search for the same in the Forum. 

      http://e2e.ti.com/support/microcontrollers/hercules/f/312/t/102102.aspx

    http://e2e.ti.com/support/microcontrollers/hercules/f/312/t/203728.aspx

    http://e2e.ti.com/support/microcontrollers/hercules/f/312/p/164944/884978.aspx#884978