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.

What is disabling my Global Interrupt Enable?

Guru 15580 points
Other Parts Discussed in Thread: OMAP-L138

I am having difficulty generating an interrupt on my OMAP-L138 custom board. I am running DSPBIOS 5. I have successfully configured one of my GPIO pins(GP1P14) as an interrupt input. I can watch the various registers being set as I step through my code.

1. PINMUX2_7_4 is set to 0x04 (GP1P14)

2. GPIO1P14 set as input (GPIO_setDir(2,30,1))

2. GPIO_BANK01->SET_RIS_TRIG = 1 << 30;

3. BINTEN set to enable Bank 1 (BINTEN = 0x02)

4. IER is set to enable INT4 (IER |= (1 << 4))

5. I have set INT4 in my .tcf file to be triggered by EVT 41 (GPIO_B1INT)

6. I can see INTMUX1.INTSEL4 correctly set to 41 in the registers view

7. I have set the function called by INT4 to post a SWI for my interrupt service routine

8. I have set the target function for the SWI_post to the address of my isr in my code.

7. I set the GIE bit and can see it enabled in CSR (_enable_interrupts(); CSR.GIE = 0x1).

However, if I set a break point at the beginning of my isr, then run the program, no interrupt occurs. If I then look at the GIE bit, it is cleared. The PGIE bit is set, but GIE is cleared. Is this normal? What causes the GIE bit to clear? My code is not clearing it directly. Could BIOS be clearing it? Or is there some other potential issue preventing my ISR from being called?

Insight appreciated.

Thx,

MikeH

 

 

  • Hmmm... Odd. If I set the function called  by INT4 directly to my ISR, then I *do* get interrupts. I guess there is some problem having the HWI post a SWI that then calls my ISR. Is there something wrong with this technique?

  • Mike,

     

    I'm not sure if you're new to DSP/BIOS or not, but when I was first learning I referenced many of the available examples for DSP/BIOS that are available on the Wiki.

    I think i started with this page : Setting up Interrupts in DSP/BIOS.

     

    There are also a lot of free BIOS Training Seminars available through TI.com that you can leverage as well, such as the Embedded Workshop using BIOS.

    Lots of example projects as well as some good slides.

     

    I would suggest to start small and work you way up. For Instance, make sure you can consistantly get the HWI to work, and then later on add in the call to the SWI.

    By reducing the variables that are in play, I find I can usually find the root cause of my problems relatively quickly.

     

  • Make sure you have checked the "use dispatcher" box since you are calling a BIOS API, and get rid of the interrupt keyword too:

    http://processors.wiki.ti.com/index.php?title=DSP_BIOS_Debugging_Tips#Cause:_Invoking_BIOS_APIs_from_the_wrong_context

  • Brad,

    Thanks for the pointers. However, I am not using "interrupt" anywhere in my code. And the Callability table says that I am allowed to call a SWI driectly from a HWI, which is what I was attempting to do. Since this didn't work I am now calling an ISR from my HWI which posts the SWI. This seems to work fine. Not sure why directly calling the SWI from inside the HWI (HWI_INT4->function: _SWI_my_swi) does not work. Anyway, things seem to be working now.

    I'm also using the dispatcher for my HWIs, except for the HWI_INT5, which uses the EDMA3LLD dispatcher.

    Thx,

    MikeH

     

  • I can't understand what's what in your post.  Is _SWI_my_swi the name of your function or the name of your SWI object?  If you want your hardware interrupt to consist solely of posting a software interrupt, here's what to do:

    1. Make sure you check the "use dispatcher" box for the HWI properties.  I recommend you set the interrupt mask to "all" as well so you don't allow pre-emption in this tiny little interrupt.
    2. For the function enter "_SWI_post"
    3. For the argument enter the name of your SWI Object, e.g. _SWI0.

    So if you've created SWI0 which corresponds to "my_swi_function" then the above code will cause "my_swi_function" to run as a result of an interrupt occurring.

    Brad

  • Brad,

    Brad Griffis said:
    For the function enter "_SWI_post"

    Aha! This is my error. I was attempting to call my SWI function directly by inserting it's address (_SWI_my_swi_fuction) into the HWI function call text box instead of inserting the _SWI_post function with an argument of my SWI object which corresponds to SWI_my_swi_fuction.

    Thx,

    MikeH