I don't know your code, but I suggest you check this:
length of RxBuffer and TxBuffer
You can use a variable that is set to 0 every time it is received, with a baud rate time of+1 every other time.
When it is greater than a certain number, the reception is considered complete
Based on the information provided, it seems that the board is not able to handle burst data above 256 characters when sending at higher baud rates like 5Mbd. This could be due to various reasons like inadequate buffer size or the code not optimized for high-speed data transmission.
To address the issue:
a) You may need to optimize the code for high-speed data transmission by implementing interrupt-driven UART communication instead of polling. This will free up the CPU to perform other tasks while transmitting the data.
b) To reduce the wasted time caused by excessive stop bits, you can consider using a more efficient protocol like UART with hardware flow control (CTS/RTS) or even switch to a faster protocol like USB if possible.
It's important to note that achieving high-speed data transmission requires careful consideration and optimization of all components involved, including hardware, software, and protocols.
The Board was ordered from AliExpress and the code on the chip inside the board, is whatever it shipped with. I have downloaded no new code.
ie this 256 byte overflow flaw is in all boards, as-shipped.
If I send small packets, with long enough pauses between (mouse clicks) there is never an issue - I can send thousands of bytes, provided they are in blocks less than 256 bytes.
If I check 384 byte file, it sends just 128 bytes, even at low BAUD of 9600. ie failure is independant of BAUD speed.