This case is the typical real-time issue.
UART without FIFO can simultaneously hold only two Tx and (independingly) Rx characters: in the shift register and in the buffer register.
Any executable code runs significantly faster from SRAM, than from the external SDRAM. Some your function misses the Rx/Tx event because of different speed of execution.
Solutions:
- Reduce baud rate and add extra stop bit.
- Try use printf() and scanf() functions. They have the software buffering by the default.
- Write more fast ISR.