Skip to content

Conversation

@gicking
Copy link
Contributor

@gicking gicking commented Jan 26, 2026

This PR fixes the following bug:

  • SoftwareSerial.flush() returns too early, see issue #2904

Motivation

I maintain a LIN master library for various architectures and serial interfaces. When porting to STM32 I noticed an faulty behavior of SoftwareSerial.flush() (see issue report). This pull request fixes this.

Validation

original:
Screenshot_SoftwareSerial_original

after bugfix:
Screenshot_SoftwareSerial_bugfix

See also this sketch SoftwareSerial_flush.zip

Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gicking
Thanks for the PR.
The commit changed SerialUSB.baud() etc. to return the actual CDC line coding
should not be in this PR.

@gicking
Copy link
Contributor Author

gicking commented Jan 26, 2026

hello Frederic,

sorry for the inconvenience! Unfortunately I am not very experienced with Github - i.e. basically I am just following instructions by ChatGPT ;-)

I understand the issue, but how can I separate the 2 branches now? Also, for my own library development I need a branch that contains both PRs.

For your help thanks a lot in advance!

@fpistm
Copy link
Member

fpistm commented Jan 26, 2026

Your previous PR is already merged #2892 . So you have to fetch the latest main from the core on your fork then rebase your branch on top of the main branch.
Then do a force push.

Easiest way to do this is:
git remote add upstream https://github.com/stm32duino/Arduino_Core_STM32.git
git fetch upstream
if you already have a main local branch
git reset --hard upstream/main
else
git checkout -b main upstream/main
Finally push on your fork (probably named origin)
git push origin main
Like this your fork is sync with the original repo.

When done you can rebase your branch on top of the main:
git checkout SoftwareSerial.flush
git rebase main
it should drop the commit for the USB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants