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.

Assigning a specific interrupt to Hwi in SYS/BIOS on 6748

Other Parts Discussed in Thread: OMAPL138, SYSBIOS

Hi,

THis should be a simple thing but I have completely failed to find out how to do it: I simply want to start SYS/BIOS Hwi thread from a peripheral interrupt (actually the SPI interrupt, but that is by the by). The manual (spruex3h, page 2-16) says to use the following in the configuration script:

Program.global.hwi0 = Hwi.create(id, '&hwiFunc', hwiParams);

And it says that "id is the interrupt number being defined". That is great, but how do I find out what the interrupt number is for the peripheral I want to use? I tried 43, because this is listed as the interrupt number for SPI1 in the data sheet. This failed to compile because 43 was "out of range". I tried 1, because this is mentioned in the SPI user guide. This failed to compile because "Hwi 1 is already in use".

What am I missing?

Cheers,

John.

 

  • OK:

    I worked out how to do this myself in the end. It is not hard but it does appear to be missing from any of the documentation, maybe a new wiki page could be created?

    It turns out that all the peripheral events can be user programmed to one of 12 CPU interrupts (INT4 through INT15). This is documented in the DSP megamodule guide (SPRUFK5). We simply have to set the event number for the SPI1 peripheral (43 from the device data sheet) into the correct field of the INTMUX registers. I have used INT5 so I need to poke 43 into bits 14-8 of INTMUX1. The CSL header files define labels for the event numbers and a structure for the registers, so the desired behaviour is achieved with:

     

    #include <ti/psp/cslr/cslr_dspintc.h>

    #include <ti/psp/cslr/soc_OMAPL138.h>

     

    CSL_DspintcRegsOvly intcRegs = (CSL_DspintcRegsOvly)(CSL_INTC_0_REGS);

    intcRegs->INTMUX1 = CSL_INTC_EVENTID_SPIINT1 << 8;

     

    I then use 5 as the ‘intNum’ argument of the 'Hwi.create' call in my config script:

     

    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');

    var hwiParams = new Hwi.Params;

    Program.global.hwi0 = Hwi.create(5, "&hwiFunc", hwiParams);

     

    With interrupts enabled in the SPI1 module, this does the trick. Note that the SPI module contains a register called ‘SPI Interrupt Level Register (SPILVL)’ which seems to imply that the SPI can only drive INT1 – however, I think that this refers to which interrupt line out of the SPI module is used for which SPI Event so that different events can drive different interrupts. As it happens, there is only one line out of the module so the SPILVL register just acts like an interrupt mask register.

    Cheers,

    John.

  • Glad to see this was resolved