Hi Community,
Please help me for below issue.
Following line sending only first letter K 5 times.
unsigned char str[] = "Kumar Rishi\r\n";
UART_DRV_SendData(UART0_IDX, str, 5);
Function:
uart_status_t UART_DRV_SendData(uint32_t instance, const uint8_t * txBuff,
uint32_t txSize)
{
assert(txBuff);
assert(instance < UART_INSTANCE_COUNT);
uart_status_t retVal = kStatus_UART_Success;
uart_state_t * uartState = (uart_state_t *)g_uartStatePtr[instance];
/* Indicates current transaction is non-blocking */
uartState->isTxBlocking = false;
/* Start the transmission process */
retVal = UART_DRV_StartSendData(instance, txBuff, txSize);
return retVal; }
static uart_status_t UART_DRV_StartSendData(uint32_t instance, const uint8_t * txBuff,
uint32_t txSize)
{
assert(instance < UART_INSTANCE_COUNT);
UART_Type * base = g_uartBase[instance];
uart_state_t * uartState = (uart_state_t *)g_uartStatePtr[instance];
/* Check that we're not busy already transmitting data from a previous
* function call. */
if (uartState->isTxBusy)
{
return kStatus_UART_TxBusy;
}
if (txSize == 0U)
{
return kStatus_UART_NoDataToDeal;
}
/* Initialize the module driver state structure. */
uartState->txBuff = txBuff;
uartState->txSize = txSize;
uartState->isTxBusy = true;
/* Enable the transmitter data register empty interrupt. The TDRE flag will
* set whenever the TX buffer is emptied into the TX shift register (for
* non-FIFO IPs) or when the data in the TX FIFO is at or below the
* programmed watermark (for FIFO-supported IPs). */
UART_BWR_C2_TIE(base, 1U);
return kStatus_UART_Success;
}