Hi
I've been able to make reliable looopback functionality by adding the following changes:
1) The main loop:
// Wait to receive input data
if (kStatus_UART_Success == UART_DRV_ReceiveDataBlocking(BOARD_DEBUG_UART_INSTANCE, &rxChar, 1u, OSA_WAIT_FOREVER))
{
RxBytesCounter++;
// Echo received character
// UART_DRV_SendDataBlocking(BOARD_DEBUG_UART_INSTANCE, &rxChar, 1u, 1000u);
}
}
and perform the tx from the UART_DRV_IRQHandler():
void UART_DRV_IRQHandler(uint32_t instance)
{
.
.
.
/* Get data and put into receive buffer */
UART_HAL_Getchar(base, uartState->rxBuff); /*original byte receptin
UART_BWR_C2_TIE(base, 0U); /* Addind Disable the transmitter data register empty interrupt */
UART_HAL_Putchar(base,* uartState->rxBuff); /*Adding transmit echo
.
This means that HW is OK but the Tx IRQ handling need some changes.
I need to reduce risks in my projects so I 'd like to know if and wgen I shal have a fix for fsl_uart_driver.c?