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

OVERWRITE EXCEPTION HANDLER

Hello,

I use the NXP LPC 2368 and want to write a function to save the exceptions Data Abort Error, Undefined Instruction Error and Pre-fetch Abort Error in a seriel EEPROM and after reset the CPU.
How can I overwrite the dummy exception handler Undef_Handler, PAbt_Handler and DAbt_Handler with C code?
I found the technical support:
http://www.keil.com/support/docs/3027.htm
If I write the irq-functions there is no warning and no error so far so good. But if I test the irq the PC stuck always in the dummy function in startup and not in my own function!
Somebody have a idea?

Parents
  • Thanks for the tip. But now the Compiler Error:
    "system\LPC2300.s(615): error: A1516E: Bad symbol 'ProgramAbortHandler', not defined or external"
    comes.

    Here my Code:
    Startup-File

    ; Exception Vectors
    ;  Mapped to Address 0.
    ;  Absolute addressing mode must be used.
    ;  Dummy Handlers are implemented as infinite loops which can be modified.
    
    Vectors         LDR     PC, Reset_Addr
                    LDR     PC, Undef_Addr
                    LDR     PC, SWI_Addr
                    LDR     PC, PAbt_Addr
                    LDR     PC, DAbt_Addr
                    NOP                            ; Reserved Vector
    ;               LDR     PC, IRQ_Addr
                    LDR     PC, [PC, #-0x0120]     ; Vector from VicVectAddr
                    LDR     PC, FIQ_Addr
    
    Reset_Addr      DCD     Reset_Handler
    Undef_Addr      DCD     Undef_Handler
    SWI_Addr        DCD     SWI_Handler
    PAbt_Addr       DCD     ProgramAbortHandler
    DAbt_Addr       DCD     DAbt_Handler
                    DCD     0                      ; Reserved Address
    IRQ_Addr        DCD     IRQ_Handler
    FIQ_Addr        DCD     FIQ_Handler
    
                                    IMPORT  SWI_Handler
    
    Undef_Handler   B       Undef_Handler
    ;SWI_Handler     B       SWI_Handler
    ;Don't need the dummy PAbt handler
    ;PAbt_Handler    B       PAbt_Handler
    DAbt_Handler    B       DAbt_Handler
    IRQ_Handler     B       IRQ_Handler
    FIQ_Handler     B       FIQ_Handler
    


    File irq.c

    void ProgramAbortHandler(void) __irq
    {
       // For Test
       while(1);
    }
    


    I think I have to declare the function because it is defined in another file. How can I do this in Assembler? Thanks

Reply
  • Thanks for the tip. But now the Compiler Error:
    "system\LPC2300.s(615): error: A1516E: Bad symbol 'ProgramAbortHandler', not defined or external"
    comes.

    Here my Code:
    Startup-File

    ; Exception Vectors
    ;  Mapped to Address 0.
    ;  Absolute addressing mode must be used.
    ;  Dummy Handlers are implemented as infinite loops which can be modified.
    
    Vectors         LDR     PC, Reset_Addr
                    LDR     PC, Undef_Addr
                    LDR     PC, SWI_Addr
                    LDR     PC, PAbt_Addr
                    LDR     PC, DAbt_Addr
                    NOP                            ; Reserved Vector
    ;               LDR     PC, IRQ_Addr
                    LDR     PC, [PC, #-0x0120]     ; Vector from VicVectAddr
                    LDR     PC, FIQ_Addr
    
    Reset_Addr      DCD     Reset_Handler
    Undef_Addr      DCD     Undef_Handler
    SWI_Addr        DCD     SWI_Handler
    PAbt_Addr       DCD     ProgramAbortHandler
    DAbt_Addr       DCD     DAbt_Handler
                    DCD     0                      ; Reserved Address
    IRQ_Addr        DCD     IRQ_Handler
    FIQ_Addr        DCD     FIQ_Handler
    
                                    IMPORT  SWI_Handler
    
    Undef_Handler   B       Undef_Handler
    ;SWI_Handler     B       SWI_Handler
    ;Don't need the dummy PAbt handler
    ;PAbt_Handler    B       PAbt_Handler
    DAbt_Handler    B       DAbt_Handler
    IRQ_Handler     B       IRQ_Handler
    FIQ_Handler     B       FIQ_Handler
    


    File irq.c

    void ProgramAbortHandler(void) __irq
    {
       // For Test
       while(1);
    }
    


    I think I have to declare the function because it is defined in another file. How can I do this in Assembler? Thanks

Children