cancel
Showing results for 
Search instead for 
Did you mean: 

Overrun issue while echo with hyperterminal

astree
Associate II
Posted on June 26, 2015 at 10:44

Hello,

Often I get an overrun error when a char is received from PC.

uint8_t UART_GetC(uint8_t * const pbyRxByte);
void Term_sending(void){
uint8_t byRxByte;
do {
while (UART_GetC(&byRxByte) == 0);
while (!((USART1->ISR & USART_ISR_TXE) == USART_ISR_TXE));
USART1->TDR = (uint8_t)byRxByte;
}
while (1);
}
uint8_t UART_GetC(uint8_t * const pbyRxByte){
if ((USART1->ISR & USART_ISR_RXNE) == USART_ISR_RXNE)
{
*pbyRxByte = (uint8_t)(USART1->RDR); //Receive data, clear flag 
return 1;
}
else
return 0;
}

Sometimes when RXNE is setted overrun error occurs as well. Could someone explain me how to fixe this kind of error. I already checked baudrate and it is ok. I get this error only when I activate HW flow control RTS/CTS Best, #usart #stm32 #overrun
1 REPLY 1
Posted on June 26, 2015 at 17:40

May be you need a more elastic buffering scheme if there is a potential for flow control to stall out the connection?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..