2015-06-26 01:44 AM
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
2015-06-26 08:40 AM
May be you need a more elastic buffering scheme if there is a potential for flow control to stall out the connection?