Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix STM32 UART: Add separate TX waker and only clear idle flag in RingBufferedUartRx #3930

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

meowcakes
Copy link

@meowcakes meowcakes commented Feb 28, 2025

This resolves an issue whereby one is unable to use a UartTx and a RingBufferedUartRx in parallel in separate tasks.

Firstly, it changes clear_idle_flag to ONLY clear the idle flag as the name suggests it should. Currently, it clears ALL set flags including TC which is checked by UartTx::flush. If the TX and RX are being used in parallel, it is possible for the RX to clear the TC flag before the TX can check it, which causes UartTx::flush to hang forever.

Secondly, it adds a separate tx_waker, otherwise when TX and RX are used in parallel they contend for the currently lone rx_waker and can overwrite each others wakers, causing hanging.

@meowcakes meowcakes marked this pull request as draft February 28, 2025 01:38
@meowcakes meowcakes marked this pull request as ready for review February 28, 2025 01:57
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.

1 participant