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.

BeagleBone Black PRU; Clear interrupt event from PRU; prussdrv.h



Hey there,

I'm new at developing for the PRU and Linux in general. I'm using the BeagleBone Black (Linux beaglebone 3.8.13-bone47), which has the AM355x processor. I'm using the prussdrv.h library to interface between the PRU and the Linux host system. 

In the linux host application, I'm using a thread to listen to events from the PRU:

void *threadFunction(void *value){
   do {
      int notimes = prussdrv_pru_wait_event (PRU_EVTOUT_1);		// event 1 is sendt from PRU, when a sample is ready to be read
      unsigned int counter_val = *(pru0DataMemory_int);
      prussdrv_pru_clear_event (PRU_EVTOUT_1, PRU0_ARM_INTERRUPT);
   } while (1);
}

I'm sending the event to the Host system from the PRU, in his way:

MOV R31.b0, PRU0_R31_VEC_VALID | PRU_EVTOUT_1

When the application is launched, it will wait at prussdrv_pru_wait_event(), but when the event is sent from the PRU the first time, it will continue executing, and somehow not clear the event at prussdrv_pru_clear_event(), causing these three lines to loop as fast as possible.

This problem was also observed by fung - see question from June 7, 2015 - who also has been following Derek Molloy's tutorials. Derek Molloy suggests: "For later work I avoided the use of interrupts and I polled memory on a thread"  -  Is this really the only solution to his problem?