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.

PRU Interrupt managing in Sitara (Beaglebone Black)

Hi,

I'm using a beaglebone black for my project and I would like to use the PRUs included into Sitara processor.

I've followed some "how to"s  found on internet and in all of them there are examples employing PRU0, but not PRU1. I've have done some tuning in order to use PRU1, but I can't make it works. My set up for using PRU with interrupt is the following:

For the C part:

#include "prussdrv.h"
#include <pruss_intc_mapping.h>
	 
[...]
tpruss_intc_initdata pruss_intc_initdata = PRUSS_INTC_INITDATA;
[...]
prussdrv_open(PRU_EVTOUT_1);
[...]
prussdrv_pruintc_init(&pruss_intc_initdata);
[...]
prussdrv_exec_program (PRU_NUM, "./prucode.bin");
prussdrv_pru_wait_event (PRU_EVTOUT_1);
/* things... */
prussdrv_pru_clear_event(PRU_EVTOUT_1,PRU1_ARM_INTERRUPT);


While, in the assembly part i do:

#define PRU1

#ifdef PRU0
#define PRU_OFFSET 0x22000
#else
#define PRU_OFFSET 0x24000
#endif

// Refer to this mapping in the file - pruss_intc_mapping.h
#define PRU0_PRU1_INTERRUPT     17
#define PRU1_PRU0_INTERRUPT     18
#define PRU0_ARM_INTERRUPT      19
#define PRU1_ARM_INTERRUPT      20
#define ARM_PRU0_INTERRUPT      21
#define ARM_PRU1_INTERRUPT      22

#define CONST_PRUCFG         C4
#define CONST_PRUDRAM        C24
#define CONST_PRUSHAREDRAM   C28
#define CONST_DDR            C31

// Address for the Constant table Block Index Register (CTBIR)
#define CTBIR          PRU_OFFSET+0x00020

// Address for the Constant table Programmable Pointer Register 0(CTPPR_0)
#define CTPPR_0        PRU_OFFSET+0x00028

// Address for the Constant table Programmable Pointer Register 1(CTPPR_1)
#define CTPPR_1        PRU_OFFSET+0x0002C


// Enable OCP master port
LBCO      r0, CONST_PRUCFG, 4, 4
CLR     r0, r0, 4         
SBCO      r0, CONST_PRUCFG, 4, 4

/* Configure the programmable pointer register for PRU0 by setting c28_pointer[15:0] field to 0x0120. This will make C28 point to 0x00012000 (PRU shared RAM).*/
MOV     r0, 0x00000100
MOV       r1, CTPPR_0
ST32      r0, r1

CLOOP:
[...]
MOV	r31.b0, PRU1_ARM_INTERRUPT	+16
[...]
JMP CLOOP

My problem is that fuction prussdrv_pru_wait_event has not a blocking behavior. Or rather, program doesn't wait on that function for the PRU instruction  MOV r31.b0, PRU1_ARM_INTERRUPT +16.


Am I doing something wrong?

  • Hi Carlo,
    TI does not support the PRU currently. At the moment it's best to turn to the community at http://beagleboard.org/Community/Forums for support.
  • Carlo Pane said:
    ... 

    CLOOP:

    [...]
    MOV	r31.b0, PRU1_ARM_INTERRUPT	+16
    [...]
    JMP CLOOP

    My problem is that fuction prussdrv_pru_wait_event has not a blocking behavior. Or rather, program doesn't wait on that function for the PRU instruction  MOV r31.b0, PRU1_ARM_INTERRUPT +16.

    Hi Carlo,

    If you have problem with some code, you'd better show us that code exactly.

    You PRU code looks correct, and dependent on what is between the "CLOOP:", and a "JMP CLOOP" might generate many events so that your felling will be that the event has a nonblocking behaviour.

    The client code (PRU1 thread) should contain something like that:

    prussdrv_pru_wait_event (PRU_EVTOUT_1);
    prussdrv_pru_clear_event (PRU1_ARM_INTERRUPT);

    I have it, and it works.

    HTH