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.

Unable to assert PRU EVTOUT1 on OMAPl138

Other Parts Discussed in Thread: OMAPL138

I'm trying to assert the EVTOUT1 interrupt from PRU0 on to the OMAPL138 ARM core, to signal a completion event. I am so far unsuccessful in doing so. I would like this to be done on channel 3 of the interrupt controller for both the PRU and ARM.

I've attempted to follow the TI Interrupt Controller Wiki page to set up interrupts. Here is my PRU application code to generate the interrupt.

#include <stdint.h>
#include "pru_ctrl.h"
#include "pru_intc.h"

volatile register unsigned int __R30;
volatile register unsigned int __R31;

#define EVTOUT1			(3) //Event 3
#define PRU_CHANNEL		(3)
#define ARM_CHANNEL		(PRU_CHANNEL)
#define PRU_VEC_VALID   (1 << 5)

/// Map EVTOUT1
inline void initializeInterrupts(void)
{
	pruIntc CT_INTC;

	// Map event 3 to channel 3
	CT_INTC.CMR0_bit.CH_MAP_3 = PRU_CHANNEL;

	// Map channel 3 to host 3
	CT_INTC.HMR0_bit.HINT_MAP_3 = ARM_CHANNEL;

	// Ensure event 3 is cleared
	CT_INTC.SICR = EVTOUT1;

	// Enable event 3
	CT_INTC.EISR = EVTOUT1;

	// Enable Host interrupt 3
	CT_INTC.HIEISR |= EVTOUT1;

	// Enable Global Interrupts
	CT_INTC.GER = 1;
}

inline void announceCompletion(void)
{
	pruIntc CT_INTC;

	//Assert EVTOUT1
	__R31 = PRU_VEC_VALID | EVTOUT1;

	// Ensure event 3 is cleared
	CT_INTC.SICR = EVTOUT1;
}

void main(void)
{
	initializeInterrupts();
	announceCompletion();
}

Is there anything obviously wrong? One thing that I can think of is that the EVTOUT1 is mapped to the wrong event. The includes are the files that come from the PRU v4.0 SDK.

Thanks

Austin

  • Hi,

    We are working on this post and will update you shortly.

    Thanks & regards,
    Sivaraj
  • Thank you. I look forward to your response.

    I have found a few issues with the above code due to some misunderstanding on my part, and have made modifications, but do not yet have successful interrupts triggering on the ARM side. Here is the adjusted code:

    #include <stdint.h>
    #include "pru_ctrl.h"
    #include "pru_intc.h"
    
    volatile register unsigned int __R30;
    volatile register unsigned int __R31;
    
    #define PRU_VEC_VALID   			        (1 << 5)
    #define PRU_SYSTEM_EVENT			(1) //Randomly choose a system event
    #define PRU_INTC_CHANNEL0			(0)
    
    /// Map EVTOUT1
    inline void initializeInterrupts(void)
    {
        pruIntc CT_INTC;
    
        // Set Interrupt 1 to map to channel 0
        CT_INTC.CMR0_bit.CH_MAP_1 = PRU_INTC_CHANNEL0;
    
        // Map channel 3 to host 3
        CT_INTC.HMR0_bit.HINT_MAP_3 = PRU_INTC_CHANNEL0;
    
        // Ensure event 3 is cleared
        CT_INTC.SICR = PRU_SYSTEM_EVENT;
    
        // Enable event 3
        CT_INTC.EISR = PRU_SYSTEM_EVENT;
    
        // Enable Host interrupt 3
        CT_INTC.HIEISR = PRU_SYSTEM_EVENT;
    
        // Enable Global Interrupts
        CT_INTC.GER = 1;
    }
    
    inline void announceCompletion(void)
    {
        pruIntc CT_INTC;
    
        //Assert EVTOUT1
        __R31 = (PRU_VEC_VALID | PRU_SYSTEM_EVENT);
    
        // Ensure event 3 is cleared
        CT_INTC.SICR = PRU_SYSTEM_EVENT;
    }
    
    void main(void)
    {
        initializeInterrupts();
        announceCompletion();
    }
    

    As stated above, this code does not work. One other issue that I'm unsure of is this line of code from pru_intc.h:

    volatile __far pruIntc CT_INTC __attribute__((cregister("PRU_INTC", far), peripheral));
    

    This file was essentially taken from the "include/am335x" directory in the pru package. It looks like all the registers map to the same address, but I'm still unsure if this line is ok.

    Thanks again for your assistance.

  • I would like to refer to the following TI wikis.
    processors.wiki.ti.com/.../PRU-ICSS
    processors.wiki.ti.com/.../PRU_Interrupt_Controller
    processors.wiki.ti.com/.../Programmable_Realtime_Unit

    You can refer some AM335x PRU example code and modify it for OMAPL138.
    git.ti.com/.../am335x
    e2e.ti.com/.../899576

    And we have PRU code in OMAPL138 starterware.
    C:\ti\OMAPL138_StarterWare_1_10_04_01\drivers\pruss.c
    C:\ti\OMAPL138_StarterWare_1_10_04_01\include\pruss.h