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.

Compiler: AM335x PRU interrupt handling

Tool/software: TI C/C++ Compiler

Hello.

Is it possible to write code in C without checking the "if" condition?
With the use of interrupts, such as is done eg in AVR microcontrollers (handler function)?

for illustration:

while (1){

/* Check bit 30 of register R31 to see if the ARM has kicked us */

if (__R31 & HOST_INT) {
/* Clear the event status */
CT_INTC.SICR_bit.STS_CLR_IDX = FROM_ARM_HOST;
/* Receive all available messages, multiple messages can be sent per kick */
while (pru_rpmsg_receive(&transport, &src, &dst, payload, &len) == PRU_RPMSG_SUCCESS) {
/* Echo the message back to the same address from which we just received */
pru_rpmsg_send(&transport, dst, src, payload, len);
}
}
}

  • Hello mhan,

    The PRU runs baremetal, single thread code for AM335x, AM437x, AM57x - so it does not allow a handler to interrupt a currently running process (which would be possible in an RTOS environment). The PRU code must manually poll to see if any interrupts have been received. 

    Regards,

    Nick