Skip to content

Clear the UART's TX/RX FIFOs at initialization #1344

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

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

jessebraham
Copy link
Member

@jessebraham jessebraham commented Mar 25, 2024

This was required in order to get the async HIL test passing for UART (which I will submit in a subsequent PR, once I have cleaned it up a bit).

I don't love the delay, but based on my testing this was the minimum amount of time required for the FIFO to actually clear. I would like to understand this better, but for the time being it works at least.

@jessebraham jessebraham mentioned this pull request Mar 25, 2024
3 tasks
Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

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

LGTM - really weird the delay is needed

One thing I have seen is that esp-idf first resets rx and then tx. Not sure if that makes a difference (in regards to the required delay). They don't seem to have the delay but they run a lot more code so the timing might just be fine for them because of that 🤷‍♂️

@jessebraham
Copy link
Member Author

One thing I have seen is that esp-idf first resets rx and then tx. Not sure if that makes a difference (in regards to the required delay). They don't seem to have the delay but they run a lot more code so the timing might just be fine for them because of that 🤷‍♂️

Ahh interesting, thanks for mentioning that. I do plan on looking into this further, as there are other (seemingly related) UART issues as well, so I will experiment with that some time.

@jessebraham jessebraham added this pull request to the merge queue Mar 25, 2024
Merged via the queue into esp-rs:main with commit f060582 Mar 25, 2024
@jessebraham jessebraham deleted the fixes/uart branch March 25, 2024 17:04
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