This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

failure to compile an interrupt handler

Hello,
I am stuck with handling interrupts on lpc3180 uC.I have the following interrupt routine:

void IRQ_Handler (void) __irq  {
        MSTIM_INT = MSTIM_INT | 2;
        PIO_OUTP_SET | = 4;
        MSTIM_CTRL = MSTIM_CTRL | 1;
  }

and the following modifications done to the startup code (PHYTEC_LPC3000.s) :

;IRQ_Handler     B       IRQ_Handler  ;(commented)
      IMPORT                  IRQ_Handler ;(added)

The problem is that the code does not compile, I get the following error description:

PHYTEC_LPC3000.s(666): error: A1163E: Unknown opcode IRQ_Handler , expecting opcode or Macro
PHYTEC_LPC3000.s:   666 00000058 IMPORT     IRQ_Handler                  ; Enable IRQ HANDLER


Could someone please give a hint of what could possibly cause the compilation failure and how should I modify the code so, that it would become acceptable?
Thanks in advance!

Parents Reply Children
  • Just found out, that after deleting the excessive line in the vector table code it actually did work OK, it is just my poor debugging skills and extremely bad mood, that prevented me from realising that, so, I beg your pardon for wasting your time! And the working variant of the interrupt vector table code is as follows:

    Vectors         LDR     PC,Reset_Addr
                    LDR     PC,Undef_Addr
                    LDR     PC,SWI_Addr
                    LDR     PC,PAbt_Addr
                    LDR     PC,DAbt_Addr
                    DCD     ||Image$$ER_IROM1$$RO$$Length|| + ||Image$$RW_IRAM1$$RW$$Length||
                    DCD     0x4000 ;PHYTEC comment: This hard codes the size
                                                               ;that the secondary bootloader uses to copy
                                                               ;binary software to SDRAM.
    
                    LDR     PC,IRQ_Addr
                    LDR     PC,FIQ_Addr
    
    Reset_Addr      DCD     Reset_Handler
    Undef_Addr      DCD     Undef_Handler
    SWI_Addr        DCD     SWI_Handler
    PAbt_Addr       DCD     PAbt_Handler
    DAbt_Addr       DCD     DAbt_Handler
                    DCD     0               ; Reserved Address
    IRQ_Addr        DCD     IRQ_Handler
    FIQ_Addr        DCD     FIQ_Handler
    
    Undef_Handler   B       Undef_Handler
    SWI_Handler     B       SWI_Handler
    PAbt_Handler    B       PAbt_Handler
    DAbt_Handler    B       DAbt_Handler
    ;IRQ_Handler     B       IRQ_Handler
    FIQ_Handler     B       FIQ_Handler
                    IMPORT  IRQ_Handler
    

    Once again, excuse me for wrong information and thanks to everyone, who helped to solve the problem!