I wrote a simple loopback code to receive characters from a PC serial terminal (Termite) and send them back.
When I send smaller numbers of characters, the code works
But, when I send a lot of characters to the STM32 it seems the UART_Data_Ready() function starts to always read 0 and characters are no longer sent back.
See below:
The problem is worse with larger baud rates.
I assume that I am doing something wrong but not sure what.
Board: Fusion for ARMv8 (USB-UART to UART1)
MCU: STM32F091RCT6
Code:
Code: Select all
void main() {
unsigned buf;
UART1_Init(115200);
while(1) {
if(UART1_Data_Ready()) {
buf = UART1_Read();
while(!UART1_Tx_Idle());
UART1_Write(buf);
}
}
}