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.

Interrupt Controller: Interrupt not signaled to the MPU

Hi community

Tools used:

  • Beagleboard OMAP35 Revision C4
  • TI Code Composer v4
  • OMAP35xx Technical Reference Manual SPRUF98K

I followed the TRM to initialize the interrupt controller, and did setup a GPTimer for the interrupt source.
I can see the GPTimer has an overflow (and will generate the overflow interrupt), but my interrupt handler is not executing.

What i did so far:

  • Place my IRQ handler into the interrupt vector table
  • Initialize the interrupt controller
  • Initialize GPTimer1 to 1ms period with overflow interrupt enabled
  • Enable the IRQ_GPTIMER1 (37) by setting the bit 5 in the INTCPS_MIR_CLEAR3 register
  • Enable the GPTimer1

I read that interrupts are disabled in Code Composer v4 while single stepping, but even if i disable all the breakpoints and run the code, my timer variable does not increase..

Can someone tell me what's my mistake?
If it helps, I could provide you the link to the whole Code Composer v4 project as a zip file.

A) GPTimer1 registers before timer start (see TISR register, no interrupt pending)

B) GPTimer1 registers after the timer has been enabled (see TISR register, overflow interrupt pending), but IRQ handler is not executed

  • For all people who might run into the same problem: I forgot to enable the interrupts in the CPSR register of the ARM-core.

  • I enabled the interrupts in the CPSR register the following way (running SVC mode). Somehow, when debugging with Code Composer this register get's overwritten..

     

    ; enable IRQ interrupts

     

    MRS R0, CPSR
    ; Read the status register
    BIC R0, R0, #0x80
    ; Clear the I/F bit
    MSR CPSR, R0
    ; Write it back to enable IRQs

    It is not working, until i modify this register directly in the debugger. What's the proper way to do it?

  • hey how do we enter svc mode. where do we place the code to enable interrupts in svc mode? or are there any pre defined instructions to do the same?? regards Anup
  • hi,MGun

     I have the same question,can you send me a sample code about how to deal with it?

    thanks,my mailbox is jgm539609@126.com

  • The easiest way to run in SVC mode is  to overwrite the boot.asm which is shipped with the TI Compiler, because this switches the processor to user mode after initialization.

    Simply extract the boot.asm file from rtssrc.zip (C:\Program Files (x86)\Texas Instruments\ccsv4\tools\compiler\tms470\lib) and put it in your project directory.
    If you do it this way, the compiler will now take your boot.asm and ignores the one defined by TI.

    There, remove the code which looks something like this:

    ;------------------------------------------------------
    ;* SET TO USER MODE
    ;*------------------------------------------------------
       MRS     r0, cpsr
       BIC     r0, r0, #0x1F  ; CLEAR MODES
       ORR     r0, r0, #0x10  ; SET USER MODE
       MSR     cpsr_cf, r0

    I have replaced it with the following code, to make it clear in which mode we are running (but as far as i remember, the processor starts in SVC mode):

    ;*------------------------------------------------------
    ;* SET TO SVC MODE
    ;*------------------------------------------------------
       CPS  #0x13

    Of course you have to deal with the stack pointers and so on (initialize the stack pointer for each mode), but i guess you understood how to do it?