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.

Why are OMAPL138 Starterware ARM isr examples not declared as interrupt functions

Other Parts Discussed in Thread: OMAPL138

The EVM examples do not use the ARM compiler interrupt keyword, they are simply declared as below:

static void TimerIsr(void)

void edma3CCComplIsr()

How are register values etc. preserved?

I have added the interrupt keyword to one of my interrupt functions which calls another function and the code now crashes. Can someone please explain the correct usage.

  • Hi Keith,

    Please let us know the name of the ARM example in ( OMAPL138 starterware ) you were using, in which you observed this...

    The DSP interrupt usage is well demonstrated in the "intc" example of the latest MCSDK 1.1 pacakage

    After installing the MCSDK version 1.1, you will find the source code of the interrupt example located at "~\ti\pdk_OMAPL138_1_01_00_01\packages\ti\csl\omapl138-lcdk\examples"

    Link to download the MCSDK, " BIOSLINUXMCSDK-OMAPL13X:" : www.ti.com/.../bioslinuxmcsdk

  • From what I can tell from looking at the StarterWare code, the context is explicitly saved using assembly code.
    Your higher level code should look something like this:
    IntRegister(SYS_INT_CCINT0, edma3CCComplIsr);
    IntRegister(SYS_INT_TINT12_0, TimerIsr);
    The IntRegister() function will save the function address in a vector array. It is defined in
    system_config\armv5\omapl138\interrupt.c
    That module will setup TI's AINTC HW module's VBR register to point to the above noted vector array. Upon an interrupt, the HIPVR1(for IRQ) or HIPVR2(for FIQ) will be loaded with correct vector. The IRQ and FIQ handlers are defined here:
    system_config\armv5\omapl138\cgt\exceptionhandler.asm
    The handlers save the context on the stack before vectoring off to HIPVR address and restore context from the stack afterwards. The handlers use the correct assember instruction to return from an exception.
    Using the interrupt keyword probably causes a return from exception too early. The stack may not get cleaned off.
  • Norman, yes I am using the IntRegister() function the same as in the examples. Thanks for your clear explanation of how this works.

    It would be useful if a note about this was added to the Starterware code/documentation to avoid confusion.