CMSIS USART_LPC43xx.c USARTn_IRQHandler Multiply Defined issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CMSIS USART_LPC43xx.c USARTn_IRQHandler Multiply Defined issue

518 Views
vincentmicallef
Contributor I

I hope someone can help.

Is this an issue with CMSIS v4.5.0 / v5?

In the Startup file there is defined USART3_IRQHandler

and in the CMSIS USART_LPC43xx.c there is a defined USART3_IRQHandler

Due to this, the compiler is stating that there is a multiply Defined.

CMSIS online states the following:

"The user application may simply define an interrupt handler function by using the handler name as shown below."

But the above is not possible in this case.

Can someone give me a solution? or a workaround?

I am stuck in creating an interrupt for USART3 (Rx). I am using numerous other interrupts with no problem. I receive the following error when compiling:

Error: L6200E: Symbol USART3_IRQHandler multiply defined (by usart_lpc43xx.o and main.o).

I am using the CMSIS Startup, system, DRIVER_USART, USART_LPC43xx files, and i receive the above error.

When debugging, and triggering an interrupt, it seems to go to the Hardfault handler??.

When examining the above files, there seems to be another "MX_USART3_IRQHandler", could someone explain this to me, or should i use this? How? I tried.

Could some one please help me out on this? Or/and provide me with a very basic program example for USARTn Interrupts using CMSIS v4.5.0 / v5.

void USART3_IRQHandler() {         volatile unsigned long iir;         iir = LPC_USART3->IIR; //clear Interrupt         NVIC_DisableIRQ(USART3_IRQn);         NVIC_ClearPendingIRQ(USART3_IRQn);         Driver_USART3.Send("\nC\n", 5);         NVIC_EnableIRQ(USART3_IRQn); }   void UART_Interrupt_Init() {         LPC_USART3->IER   = 0x03;         NVIC_EnableIRQ(USART3_IRQn); } 

UART3 without interrupts functions well. I did not place the UART3 Init code to simplify.

Thank you

0 Kudos
1 Reply

364 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Vincent,

Are you using LPCXpresso? When you create a project using the LPCXpresso IDE project wizard, the startup code generated includes a vector table containing a set of default interrupt handlers, these default handlers are defined higher up the startup file as weak so that if your main application code provides a (non-weak) implementation of a handler function with exactly the same name, this will be used instead of the default version contained in the startup code.

Please also notice that the use of LPCOpen is now recommend for most LPC MCUs, rather than the 'old-style' CMSIS-CORE library projects and examples. You can download the LPC43xx LPCOpen packages from this link:

LPCOpen Software for LPC43XX|NXP 


Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos