After a day of stress testing, I found that MQX crashes intermittently where the task handling the UART goes into MQX_UNHANDLED_INTERRUPT state.
My uartInitialize() method which I can during the _create_task() is as follows:
Error uartInitialize(void)
{
NVIC_SetPriority(UART4_RX_TX_IRQn, 1);
//OSA_InstallIntHandler(UART4_RX_TX_IRQn, UART4_RX_TX_IRQHandler); (Wasn't sure if this was necessary - didn't help!)
// Initialize the uart module with base address and config structure
if (kStatus_UART_Success !=
UART_DRV_Init(UART4_IDX, &uartState, &uartConfig))
{
SEGGER_RTT_printf(0, "UART Failed to initialize! Exiting.\r\n");
return(ERROR);
}
SEGGER_RTT_printf(0, "UART initialized.\r\n");
return(NO_ERROR);
}
As I'm new to KSDK and MQX, this has been challenging. Does anyone have a working example of talking to UART4 with KSDK and MQX that they can share?