Question
Trasmitting through UART
Posted on September 23, 2015 at 20:41
I am trying to transmit a string of characters through USART3 of a STM32F215RG using the code below. If I run this code, I see no output on my terminal. If I single step through this code I see all characters on the terminal. If I replace the wait for TXE to go high with a HAL_Delay(1), I see all characters on the terminal. What am I missing ?
char
textbuff[32];
strcpy
( textbuff,
''Hello\r\n''
);
for
( i = 0 ; i <
strlen
( textbuff ) ; i++ )
{
while
( USART3->SR & UART_FLAG_TXE == 0 )
;
USART3->DR = textbuff[ i ];
}
Andy
#usart-txe