Forum Discussion
Based on your description, seems like is a buffer overflow issue. There are two different types of buffer overrun: hardware and software buffer overrun. Both types of buffer overrun are more likely to happen when transferring continuous streams of large amounts of data across the serial port
Check this https://forum.micropython.org/viewtopic.php?t=6244. Can try to increase the buffer size may be to 128 in altera_avalon_uart.h. I don't understand this part even after changing and saving the altera_avalon_uart.h file it is not getting reflected in altera_avalon_uart.h file. Have you try to move out the file and make changes. Then paste back to original place by allowing permission.
Check also this https://stackoverflow.com/questions/27322048/serial-uart-buffer-overflow-at-high-speed. Obviously flow control mechanism(RTS/CTS) should able to solve the issue. You can refer to this https://www.intel.com/content/www/us/en/docs/programmable/683130/22-1/introduction.html (page 140, 146). You can also refer to this https://community.intel.com/t5/Nios-II-Embedded-Design-Suite/UART-Core-with-CTS-RTS/m-p/81395 and https://community.intel.com/t5/Nios-II-Embedded-Design-Suite/UART-Core-with-CTS-RTS/td-p/81395?profile.language=zh-TW