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 event mapping

Other Parts Discussed in Thread: TMS320DM8148, SYSBIOS

Hi,

I'm trying to map an interrupt event to a specific vector on th 8148/Bios6.   The bios call to the eventMap (if I've included the right files) says the function is undefined:

for example:

Hwi_eventMap(5, 8);       

 

I checked the RTSC package information (file:///C:/Program%20Files/Texas%20Instruments/bios_6_32_05_54/docs/cdoc/index.html) and didn't find it.

 

I'm investigating something called eventID in the hwiParams.  Could this be where I select an event?    The documentation for eventId says the following:

 

config Hwi_eventId  // instance

Interrupt event ID (Interrupt Selection Number)

C synopsis target-domain

struct Hwi_Params {
      ...
    Int eventId;

 

DETAILS

Default is -1. Not all targets/devices support this instance parameter. On those that don't, this parameter is ignored.


The bios user guide says the following:

The "eventId" accommodates 'C6000 devices that allow dynamic
association of a peripheral event to an interrupt number. The default
value of -1 leaves the eventId associated with an interrupt number in its
normal (reset) state (that is, no re-association is required).
Int eventId = -1;


Is 're-association' the same thing as event mapping?

ie like this?  hwiParams.eventId = my interrupt event #


Thanks,
Matt
  • Quick follow-on to the above.  I'm trying to map GPIOINT3A into vector 5, but that particular event is mapped itself through the media controller INTC crossbar.    It is event 6 there, which is shared with 'Usage Fault' on the regular controller.

    Do I have to map the media controller to the event first somehow, then have the dispatcher parse the secondary controller event somehow?    Does this have a tidy API through Bios?

     

    This is what I have so far BTW.  Maybe it will make it easier to talk about.     eventId cannot be '6' probably.   It will pick up on the wrong event.

     

        Hwi_Params hwiParams;
        Hwi_Handle myHwi;
        Error_Block eb;

        /* Initialize error block and hwiParams to default values */
        Error_init(&eb);
        Hwi_Params_init(&hwiParams);

        hwiParams.arg = 0;
        hwiParams.enableInt = FALSE;
        hwiParams.maskSetting = 0x0020;
        hwiParams.eventId = 6; // gpio3A
        myHwi = Hwi_create(5, myIsr, &myHwi, &eb);

     

        Hwi_enableInterrupt(5);
        Hwi_enable();

     

    Thanks,
    Matt

  • Matt,

    When you create a Hwi with Hwi_create(intNum, fxn, &params, &errorblock) specify the 'eventId' in your params and it will map that specified event to the specified interrupt number.  In fact, if you specify the 'eventId' to be something other than the default of -1, it will internally call  Hwi_eventMap(intNum, eventId) for you.  So what you are saying above is correct.

    Use Hwi_eventMap() if you want to change a mapping of a particular interrupt to a different eventId.   "re-association" is the same thing as event mapping.

    Judah

  • Matt

    If you take a look at the datasheet for the TMS320DM8148 found at the followng link, then jump to page 213 "C674x DSP Interrupts" you wll find a table listing the "Event ID" and source.  You will find that GPIOINT3A is mapped to event id 57.

    http://www.ti.com/product/tms320dm8148

    You code should look something like the following.  I removed the call to Hwi_enableInterrut(5) because you can have it enable by setting it in the params.  I also removed the call to Hwi_enable() because BIOS enables interrupts for you in BIOS_start().  You only need this if you had explicitly disabled interrupts yourself and you shouldn't call Hwi_enable in main() if this is where the code is being called.

        Hwi_Params hwiParams;
        Hwi_Handle myHwi;
        Error_Block eb;

        /* Initialize error block and hwiParams to default values */
        Error_init(&eb);
        Hwi_Params_init(&hwiParams);

        hwiParams.arg = 0;
        hwiParams.enableInt = TRUE;                    // eliminates the need to call Hwi_enableInterrupt(5);
        hwiParams.maskSetting = 0x0020;
        hwiParams.eventId = 57; // gpio3A
        myHwi = Hwi_create(5, myIsr, &myHwi, &eb);

      Judah

  • For Bios interrupt clean up, is this acceptable or is it overkill?

     

            Hwi_disable();                             // disable interrupts global
            Hwi_disableInterrupt(5);            // disable individual IER
            Hwi_setFunc(gpi_myHwi, (ti_sysbios_hal_Hwi_FuncPtr)unregistered_interrupt_default, 0);     // set function to empty function
            Hwi_delete(&timer_hwi);          // delete handle

    Is there more or less to do here?

    Thanks,
    Matt

  • mes said:

    For Bios interrupt clean up, is this acceptable or is it overkill?

    Hi Matt --

    I think this is overkill.   Hwi_delete() calls Hwi_Instance_finalize() which disables the interrupt and plugs the vector with the dummy vector.    See below snip from the latest soruces.  You can see the sources yourself in ti/sysbios/family/c64p/Hwi.c.

    Regards,

    -Karl-

     

    Void Hwi_Instance_finalize(Hwi_Object *hwi, Int status)
    {
        Int i, cnt;
        UInt intNum;

        for (intNum = 0; intNum < 16; intNum++) {
            if (Hwi_module->dispatchTable[intNum] == hwi) {
                break;
            }
        }

        Hwi_disableInterrupt(intNum);
        Hwi_module->dispatchTable[intNum] = NULL;
        Hwi_plug(intNum, Hwi_unPluggedInterrupt);