Bug Description
SoftwareSerial.flush() returns before the last byte is sent, i.e. after sending 2nd last byte. This is unexpected and different from HardwareSerial.flush() and other core implementations
Reproduction
- flash this sketch SoftwareSerial_flush.zip
- measure pins D11(=TxD) and D3(=testpin) with logic analyzer
Expected behavior
SoftwareSerial.flush() should return after the last byte from SoftwareSerial.write(buf, len) has been sent. This is the behavior of HardwareSerial.flush() and also other core implementations
Screenshots
Expected behavior (from HardwareSerial.flush()):

Actual behavior of SoftwareSerial.flush()):

Desktop:
- OS: Linux / Ubuntu
- STM32 core v2.12.0
- Arduino IDE version: 2.3.7
- STM32 core version: 2.12.0
Board:
Bug Description
SoftwareSerial.flush()returns before the last byte is sent, i.e. after sending 2nd last byte. This is unexpected and different fromHardwareSerial.flush()and other core implementationsReproduction
Expected behavior
SoftwareSerial.flush()should return after the last byte fromSoftwareSerial.write(buf, len)has been sent. This is the behavior ofHardwareSerial.flush()and also other core implementationsScreenshots
Expected behavior (from

HardwareSerial.flush()):Actual behavior of

SoftwareSerial.flush()):Desktop:
Board: