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

Interrupt vector issues ( cant figure it out!)

Hello, I am having issues implementing the ISR routine on the CORTEX-M3, this exact setup works when I use it with RTX but not as standalone code. When I compile it says cancpp.axf: Error: L6218E: Undefined symbol GPI_ISR (referred from startup.o). But no issues when I build with RTX OS selected.

This is a snip-it of code: GPI_ISR should be the function it branches to.

******************************************************************************
;
; The vector table.
;
;******************************************************************************
        EXPORT  __Vectors
                IMPORT  GPI_ISR ;[WEAK]



__Vectors
        DCD     StackMem + Stack            ; Top of Stack
        DCD     Reset_Handler               ; Reset Handler
        DCD     NmiSR                       ; NMI Handler
        DCD     FaultISR                    ; Hard Fault Handler
        DCD     IntDefaultHandler           ; MPU Fault Handler
        DCD     IntDefaultHandler           ; Bus Fault Handler
        DCD     IntDefaultHandler           ; Usage Fault Handler
        DCD     0                           ; Reserved
        DCD     0                           ; Reserved
        DCD     0                           ; Reserved
        DCD     0                           ; Reserved
        DCD     IntDefaultHandler           ; SVCall handler
        DCD     IntDefaultHandler           ; Debug monitor handler
        DCD     0                           ; Reserved
        DCD     IntDefaultHandler           ; PendSV Handler
        DCD     IntDefaultHandler           ; SysTick Handler
        DCD     GPI_ISR                             ; GPIO Port A

.

in the main.c I have


void   GPI_ISR   (void)
{

}

.

Parents
  • I am using C++.

    Using the

     IMPORT  GPI_ISR [WEAK]
    

    syntax it will build but wont go to the function. If I remove the [WEAK] syntax, it wont build and says:

    cancpp.axf: Error: L6218E: Undefined symbol GPI_ISR (referred from startup.o).

    This is what I copied from the MAP file, it shows GPI_ISR as an undefined Weak Reference:

    
      BuildAttributes$$THM_ISAv4$P$D$K$B$S$PE$A:L22UL41UL21$X:L11$S22US41US21$IEEE1$IW$USESV6$~STKCKD$USESV7$~SHL$OTIME$ROPI$IEEEJ$EBA8$UX$STANDARDLIB$REQ8$PRES8$EABIv2 0x00000000   Number         0  anon$$obj.o ABSOLUTE
        __ARM_use_no_argv                        0x00000000   Number         0  main.o ABSOLUTE
        __Vectors                                0x00000000   Data           0  startup.o(RESET)
        __dso_handle                             0x00000000   Number         0  startup.o(RESET)
        _printf_flags                            0x00000000   Number         0  printf_stubs.o ABSOLUTE
        _printf_return_value                     0x00000000   Number         0  printf_stubs.o ABSOLUTE
        _printf_sizespec                         0x00000000   Number         0  printf_stubs.o ABSOLUTE
        _printf_widthprec                        0x00000000   Number         0  printf_stubs.o ABSOLUTE
        GPI_ISR                                   - Undefined Weak Reference
        SHT$$ARM_EXIDX$$Base                      - Undefined Reference
        SHT$$ARM_EXIDX$$Limit                     - Undefined Reference
    

    Thanks for the help.

Reply
  • I am using C++.

    Using the

     IMPORT  GPI_ISR [WEAK]
    

    syntax it will build but wont go to the function. If I remove the [WEAK] syntax, it wont build and says:

    cancpp.axf: Error: L6218E: Undefined symbol GPI_ISR (referred from startup.o).

    This is what I copied from the MAP file, it shows GPI_ISR as an undefined Weak Reference:

    
      BuildAttributes$$THM_ISAv4$P$D$K$B$S$PE$A:L22UL41UL21$X:L11$S22US41US21$IEEE1$IW$USESV6$~STKCKD$USESV7$~SHL$OTIME$ROPI$IEEEJ$EBA8$UX$STANDARDLIB$REQ8$PRES8$EABIv2 0x00000000   Number         0  anon$$obj.o ABSOLUTE
        __ARM_use_no_argv                        0x00000000   Number         0  main.o ABSOLUTE
        __Vectors                                0x00000000   Data           0  startup.o(RESET)
        __dso_handle                             0x00000000   Number         0  startup.o(RESET)
        _printf_flags                            0x00000000   Number         0  printf_stubs.o ABSOLUTE
        _printf_return_value                     0x00000000   Number         0  printf_stubs.o ABSOLUTE
        _printf_sizespec                         0x00000000   Number         0  printf_stubs.o ABSOLUTE
        _printf_widthprec                        0x00000000   Number         0  printf_stubs.o ABSOLUTE
        GPI_ISR                                   - Undefined Weak Reference
        SHT$$ARM_EXIDX$$Base                      - Undefined Reference
        SHT$$ARM_EXIDX$$Limit                     - Undefined Reference
    

    Thanks for the help.

Children