AnsweredAssumed Answered

A UART problem

Question asked by Evgeny Erenburg on Jun 29, 2017
Latest reply on Jul 5, 2017 by Kerry Zhou

The functions I use

 

void UART_SendByte (UART_MemMapPtr channel, char ch)
{
    while(!(UART_S1_REG(channel) & UART_S1_TC_MASK) ) {}
     
    /* Send the character */
    UART_D_REG(channel) = ch;
 }

 

void UART_SendString(UART_MemMapPtr uartChannel, const char *str)
{
    while (*str)
    {
        UART_SendByte(uartChannel, *str++);
    }
}

 

Now I test it.

 

 UART_SendString(UART2_BASE_PTR, "hello\r");

 

The problem - the first char is not displayed on a terminal. I see 'ello'.

Outcomes