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.

Hwi interrupt number in SYS/BIOS

Other Parts Discussed in Thread: OMAPL138, SYSBIOS

Hi,
I'm using OMAP L-138 experiment kit, I want to know the relation between Interrupt number and Event Id because I need to make a Hwi interrupt for USBOTG and Its Event Id=19, the problem is I don't to which Interrupt Number to use ??

Thanks in advance. Regards.
Muhammad

  • Hi Muhammad,

    Here's a short description of the C674x interrupt controller:

    The OMAPL138 DSP (C674x) has an interrupt controller that is composed of an event combiner and an interrupt selector. The system events (upto 124) are routed to both the interrupt selector (a multiplexer that maps system events to CPU interrupt inputs) and the event combiner. The event combiner basically groups multiple system event inputs into 4 possible event outputs. These 4 output events can be forwarded to one of the 12 CPU interrupt inputs via the interrupt selector. The idea behind the event combiner is to allow multiple system events even though the CPU can accept a maximum of 12 interrupt inputs.

    In your application, Event Id 19 would be part of event group 0. You would need to program the Event Combiner module to map Event Group 0 to one of the CPU interrupts (say INT 10) and then create a Hwi for INT 10. Here's some C code to show you how this can be done:

        Hwi_Params params;
        Error_Block eb;
        
        // Initialize the error block
        Error_init(&eb);
        
        // Plug the function and argument then enable event 19
        EventCombiner_dispatchPlug(19, &myEvent65Fxn, 19, TRUE);
      
        // Initialize the Hwi parameters
        Hwi_Params_init(&params);
        
        // The event Id must be set to the combined event for event 19.
        // The combined event is GEM event Id 0.
        params.eventId = 19 / 32;
        params.arg = params.eventId;
        
        // Enable the interrupt.
        params.enableInt = TRUE;
        
        // Create the Hwi on interrupt 10 and specify the 'EventCombiner_dispatch'
        // as the function.
        Hwi_create(10, &EventCombiner_dispatch, &params, &eb);

    In your *.cfg file you need to add the EventCombiner module in addition to Hwi:

    var EventCombiner = xdc.useModule('ti.sysbios.family.c64p.EventCombiner');

    Best,

    Ashish

  • Hi Ashish,

    Thank you for replying on my question. I appreciate your help as it really helped me.

    Regards.
    Muhammad