-
Notifications
You must be signed in to change notification settings - Fork 349
feat: uart break send + detect #4284
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
base: main
Are you sure you want to change the base?
Conversation
| /// Waits for a break condition to be detected. | ||
| /// | ||
| /// This is a blocking function that will continuously check for a break condition. | ||
| #[instability::unstable] | ||
| pub fn wait_for_break(&mut self) { | ||
| while !self.uart.info().brk_det().bit_is_set() { | ||
| // wait | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bugadani - I added wait_for_break to complete the HIL test but I would intend to use it more as an interrupt handler now that we have Rx event for break detection.
Do you approve of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think doing both should be fine. This function has lower latency than any interrupt handler would, so it can probably stay and remain useful in this form.
It makes sense to add an UartInterrupt::Break variant.
It would be nice to have a wait_for_break_with_timeout variant, and an async fn wait_for_break_async, too.
|
@bugadani - can you tell why this isn't compiling for me? |
|
ESP32-C2, C3 and H2 don't have GPIO16 and 17 |
|
@bugadani - can you help me understand why my HIL test is failling only on |
|
My guess is that you need to start waiting for a break condition before you stop sending it. |
@bugadani - two fixes I made to get all passing 1. Enabling of the break detection interrupt before first send
This resulted in all except 2.
|
HIL Tests
|
|
@bugadani - any idea why esp32 HIL hardware is failing last few builds? (...and so on, all HIL tests fail only on this chip) |
|
Don't worry about that. probe-rs can't recover the esp32 if it ends up partially flashed when a HIL run is cancelled, or sometimes when the firmware runs into some state that I don't yet know. |
Thank you for your contribution!
We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:
Submission Checklist 📝
cargo xtask fmt-packagescommand to ensure that all changed code is formatted correctly.CHANGELOG.mdin the proper section.Extra:
Pull Request Details 📖
Description
Continuation of #3177 - aiming for 1.0
Testing
Need help with HIL testing