Open KurtE opened 10 months ago
Hi @KurtE , we tried to get this fixed long time ago in mbed-os https://github.com/ARMmbed/mbed-os/pull/14600 but the proposal was then rejected. At the moment, there is no cross architecture way to make sure the FIFO is flushed, so we have to deal with it (until we find a better solution).
@pennam If you submit https://github.com/ARMmbed/mbed-os/pull/14600 to mbed-ce/mbed-os, I will review and merge!
As I mentioned in the forum post: SerialX (X=1-4) are unbuffered? surprised
The call to SerialX.flush() does not work as I expected, nor does it comply with the documentation. https://www.arduino.cc/reference/en/language/functions/communication/serial/flush/
To reproduce:
Results captured by Logic analyzer:
The hardware appears to have a Transfer Complete (TC) status, which looks like it should be able to do this properly. Alternatively, is to add some random delay after your transfers to make up for this issue, which I personally would prefer to avoid.
Otherwise, you are likely to see variations of this same issue, like: #389