IRQ Interrupt Handler: LPC3250

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by jubiamathew on Fri Jul 31 02:59:40 MST 2015
We have created a project for LPC3250 processor on a custom board. We have a hardware interrupt to GPIO-2. If we enable this interrupt before calling the main function as it is done in the default start-up file(cr_startup_lpc32.s), then system goes to the IRQ mode and IRQ will be disabled in the Program Status Register(CPSR) and interrupts are not getting processed. The dis-assembly view does not show the code which is loaded, control is at . If we try to enable the interrupts by setting a value 0x5F to CPSR inside main function the execution does not proceed from that point. We are in a confusion on when and how to enable  the interrupts? Can you please help us on this?

Given below is the modified vector table.

        LDR   pc,_rset                 // reset
        LDR   pc,_undf                  // undefined
        LDR   pc,_swi                   // SWI/SVC
        LDR   pc,_pabt                  // program abort
        LDR   pc,_dabt                  // data abort
        NOP                             // Reserved for the flash checksum
//      LDR   pc,[pc,#-0xFF0]           // IRQ - read the VIC register
        LDR      pc,_irq                    // or go to default handler
        LDR   pc,_fiq                   // FIQ

_rset:    .word _mainCRTStartup           // reset handler - from cr_startup_lpc32xx.s
_undf:  .word __undf                    // undefined
_swi:   .word _swi_handler                // SWI
_pabt:  .word __pabt                    // program abort
_dabt:  .word __dabt                    // data abort
_irq:   .word CIrqHandler
_fiq:   .word __fiq                        // FIQ

* Some simple default handlers
__undf: B     .                        // undefined
__pabt: B     .                         // program abort
__dabt: B     .                         // data abort
/*__irq:  B     _CIrqHandler    */              // IRQ
__fiq:  B     .                         // FIQ

CIrqHandler definition:
ISR-CIrqHandler is defined in main.c.
void CIrqHandler(void)
Also please let us know if this is the correct way of ISR branching if the function is in C.
We did not find relevant information in the FAQ:https://www.lpcware.com/content/faq/lpcxpresso/startup-code-interrupt-handlers