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.

Using IntDefaultHandler instead of UARTIntHandler for Interrupt Request

Hi All,

I am trying to use the IntDefaultHandler for my application instead of the UARTIntHandler. For this I have modified the startup file by changing the  EXTERN  IntDefaultHandler and by interchanging the values of 

DCD IntDefaultHandler ; UART0 Rx and Tx
DCD UARTIntHandler ; UART1 Rx and Tx

But I still keep getting error "startup_rvmdk.S(306): error: A1108E: Multiply defined symbol 'IntDefaultHandler'"

Line 306 is basically where the IntDefaultHandler is located. Please let me know where I'm going wrong.

Thanks!

IntDefaultHandler
B IntDefaultHandler

;******************************************************************************
;
; Make sure the end of this section is aligned.
;
;******************************************************************************
ALIGN

;******************************************************************************
;
; Some code in the normal code section for initializing the heap and stack.
;
;******************************************************************************
AREA |.text|, CODE, READONLY

;******************************************************************************
;
; The function expected of the C library startup code for defining the stack
; and heap memory locations. For the C library version of the startup code,
; provide this function so that the C library initialization code can find out
; the location of the stack and heap.
;
;******************************************************************************
IF :DEF: __MICROLIB
EXPORT __initial_sp
EXPORT __heap_base
EXPORT __heap_limit
ELSE
IMPORT __use_two_region_memory
EXPORT __user_initial_stackheap
__user_initial_stackheap
LDR R0, =HeapMem
LDR R1, =(StackMem + Stack)
LDR R2, =(HeapMem + Heap)
LDR R3, =StackMem
BX LR
ENDIF

;******************************************************************************
;
; Make sure the end of this section is aligned.
;
;******************************************************************************
ALIGN

;******************************************************************************
;
; Tell the assembler that we're done.
;
;******************************************************************************
END

  • Hello Kashif

    The IntDefaultHandler would have been defined in your main code as well, As a result when the linker tries to link the obj to get the final bin/axf file, it sees two object file containing the IntDefaultHandler and is not able to resolve the same.

    Remove the IntDefaultHandler from the startup file.

    However do note that all Interrupts will now map to the IntDefaultHandle ISR

    Regards

    Amit

  • Hello Amit,

    Thanks for the reply. A couple of queries, as I think I'm a bit confused here.

    IntDefaultHandle ISR is different from  IntDefaultHandler? If so, where would this be?

    2ndly, Remove the IntDefaultHandler from the startup file. means how much should I remove? The declaration or the entire definition of the handler or the lines where I interchanged with the UART Handlers?

    Thanks!

  • Hello Kashif,

    Sorry, that was a typo in the name. I missed "r".

    The IntDefaultHandler "must" have been declared in your application code. Is that correct?

    If yes, then comment out the following lines in the startup file

    IntDefaultHandler
    B IntDefaultHandler

    if no, then it is not possible for the linker to give such an error. The only thing I can think of is the fact that you have placed an EXTERN to the IntDefaultHandler

    Regards

    Amit

  • Hi Amit,

    Thanks for the clarification. I had to make a few other changes  as below:

    You were right about the EXTERN declaration. That needs to be commented. 

    IntDefaultHandler
    B IntDefaultHandler both can be left as they are because they might be used as default handlers for other peripherals. 

    The line DCD UARTIntHandler    ; UART1 Rx and Tx needs to be commented

    Thanks!

    BR,

    \Kashif

  • Hello Kashif

    Thanks for posting the update. Having such updates than "it is working" reduced a lot of load for members on the forum to answer the same question at times

    Regards

    Amit