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.

Cannot get HWI interrupts to work

Attached is some sample code.

It just starts up a timer and fires a periodic interrupt.

It works fine under CCS3.1 with BIOS 4.9.270.

I cannot get it to work at all under CCS4.1 with BIOS 5.41.04.18.

 

I'm sure that I'm missing something basic, but I cannot figure out what it is.

 

Thanks for any help,

  Peter Steinberg

example.zip
  • Hi Peter,

    It looks like the ISR is never getting mapped to any of the actual hardware interrupts in your code. In the CSL this is accomplished with the IRQ_map() function, but because you are in the world of BIOS I encourage you to use the either the static GUI configuration tool or the HWI API if dynamic creation is necessary.

    The HWI module's API is discussed in section 2.12 of the BIOS API guide and functions similar to the CSL's IRQ module; however, this has the added bonus of being plugged into the BIOS dispatcher thus informing the BIOS kernel where the PC is at all times.

    For dynamic configuration of an interrupt into the BIOS dispatcher you will need something similar to the following:

    HWI_eventMap(IRQ_EVT_TINT1, eventID /* 4-15 */);

    HWI_dispatchPlug(IRQ_EVT_TINT1, (Void*) isrT1, dmachan /* 1-16 */ , attrs);


    which is essentially the same code you wrote using the CSL. Note that you will still need your IRQ_enable() call for this and any other interrupts you create dynamically or statically.

    I hope that this helps, but please let me know if you run into any other roadblocks.

  • i added the lines:

        HWI_eventMap (IRQ_EVT_TINT1, C62_INT15);
    HWI_dispatchPlug (IRQ_EVT_TINT1, (Fxn) isrT1, 1, &HWI_ATTRS);

    before the TIMER_open call and still do not get a hardware interrupt.

    I also tried with the DMA channel set to -1 as specified in the documentation with no effect.

    I also added a call C62_enableIER (C62_EINT15).  No improvement.

     

    I do not want to configure my hardware ISR's through the bios configuration file because the firmware installs different interrupt handlers at various times.

    I do not want to have my hardware ISR determine which interrupt is active and call the proper function because that destroys the modularity of our codebase.

     

    Peter

  • If I use the correct arguments to the HWI calls:

        HWI_eventMap (C62_INT15, IRQ_EVT_TINT1);
    HWI_dispatchPlug (C62_INT15, (Fxn) isrT1, 1, &HWI_ATTRS);

    it works correctly and I can reconfigure my HWI's on the fly.

    Thanks,
    Peter Steinberg