Skip to content

SoftwareSerial.flush() returns too early #2904

@gicking

Description

@gicking

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

  1. flash this sketch SoftwareSerial_flush.zip
  2. 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()):
Image

Actual behavior of SoftwareSerial.flush()):
Image

Desktop:

  • OS: Linux / Ubuntu
  • STM32 core v2.12.0
  • Arduino IDE version: 2.3.7
  • STM32 core version: 2.12.0

Board:

  • Name: Nucleo-STM32L432KC

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't working

    Type

    Projects

    Status

    To do

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions