First of all, I'm using the following board and OS,
Board : twrk65f180m
OS : MQX
I'm trying to get the interrupt to work for my UART. I'm trying to use UART2 for my application.
Without interrupt, I can send data successfully. After I enable the interrupt, I can see that the interrupt is happening. It goes to _int_default_isr(void *vector_number) in int.c file. Where the vector number reads 0x33 which is the vector number of INT_UART2_RX_TX in the vector table. The interrupt keeps happening continuously which I believe because the interrupt is not serviced. But the weird thing here is that the interrupt starts happening even before I send the data. Is this right?
My second problem is, I want to redirect the interrupt to my own ISR which I tried to do by using _int_install_isr. But the interrupt still goes to _int_default_isr. I'm not sure if I'm doing something wrong.
Below is my code :
PORTE_PCR17 = PORT_PCR_MUX(0x3); // UART is alt3 function for this pin
PORTE_PCR16 = PORT_PCR_MUX(0x3); // UART is alt3 function for this pin
uart_init (UART2_BASE_PTR, 60000, 115200);
UART_C2_REG(UART2_BASE_PTR) |= UART_C2_TIE_MASK;
UART_C2_REG(UART2_BASE_PTR) |= UART_C2_TCIE_MASK;
_nvic_int_init(INT_UART2_RX_TX, 2, TRUE);
_int_install_isr(INT_UART2_RX_TX, CLX_Tx_ISR_Handler_Debug, NULL);
Also, I don't see any examples for UART with interrupts. Can anyone direct me to a UART example using interrupt with MQX?
Your help is much appreciated. Thank you.