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: QSPI synchronous read operation hangs when FIFO is not full #3724

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

CNLHC
Copy link
Contributor

@CNLHC CNLHC commented Jan 5, 2025

The current QSPI synchronous read function uses tcf!=1 and ftf!=1 as the polling condition. However, this condition fails when the transfer is complete and the FIFO is not full, as both tcf and ftf will be 0. This causes the read loop to block indefinitely, leaving data unread in the FIFO.

This PR resolves the issue by using the correct polling condition: tcf!=1 and flevel==0. This ensures the loop terminates only when the transfer is complete and the FIFO is empty.

Monitoring the flevel register during the read operation confirmed that it remained at 15 (FIFO_SIZE-1) when the issue occurred, validating the hypothesis.

Copy link
Member

@Dirbaio Dirbaio left a comment

Choose a reason for hiding this comment

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

thanks!

@Dirbaio Dirbaio added this pull request to the merge queue Jan 7, 2025
Merged via the queue into embassy-rs:main with commit 7c3099b Jan 7, 2025
7 checks passed
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