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.

LP-AM243: About interrupt on pru core

Part Number: LP-AM243

Tool/software:

Hello TI Engineer,

I need to use interrupts in my project with the PRU on the LP-AM243 board. I reviewed the PRU interrupt sections in the documentation, but I didn't find a function similar to an ISR (Interrupt Service Routine).

In summary, a PRU interrupt detects an interrupt by checking the relevant bit in the R31 register within a while loop. When an interrupt occurs, the relevant bit in the R31 register is set, and the code enters an if block.

If I understand correctly, how is this different from polling? I don't see the advantage of using interrupts in this case.

Is there a structure similar to an ISR? Or am I misunderstanding something? I would greatly appreciate your help.

  • Hi ,

    Thanks for your query.

    I will check on this and get back to you.

    Regards

    Ashwani

  • Hello ,

    Thank you for your response. I am waiting for your response. Good luck.

  • Hi ,

    In summary, a PRU interrupt detects an interrupt by checking the relevant bit in the R31 register within a while loop. When an interrupt occurs, the relevant bit in the R31 register is set, and the code enters an if block.

    PRUICSSG INTC supports generation of 20 Host Interrupts
    Host Interrupts 0 to 1 shared between the PRUs (PRU0 and PRU1) and TX_PRUs (TX_PRU0 and TX_PRU1).
    Host Interrupts 10 to 11  for the RTU PRUs (RTU_PRU0 and RTU_PRU1).
    Host Interrupts 2 to 9  exported from the PRU_ICSSG internal INTC for signaling the device level interrupt controllers (pulse and level provided).
    Host Interrupts 12 to 19 for the Task Managers.

    In summary, a PRU interrupt detects an interrupt by checking the relevant bit in the R31 register within a while loop. When an interrupt occurs, the relevant bit in the R31 register is set, and the code enters an if block.

    Above statement is correct if you are using host Interrupts (0,1,10,11), and if you are looking to have context store and restore similar to ISR, then you can map INTC channels to host Interrupts 12 to 19 and use TASK manager

    Please refer this section of AM243x TRM PRUICSSG_TASK_MANAGER, to understand on how to use this.

    Important note : When switching between tasks, the Task Manager only saves and restores the program counter (PC) and flags, firmware is responsible for saving and restoring any Rn internal registers that it will override during a task. IPC SPAD buffers, Data RAM, or Shared RAM (Data RAM2) can be used to store the Rn register value.

    PRU Macros related to task manager: Download (MCU-PLUS-SDK-AM243X) & refer this file {mcu_plus_sdk}\source\pru_io\firmware\common\icss_tm_macros.inc 

    Let us know, if you face issues in understanding and using this.