-
Notifications
You must be signed in to change notification settings - Fork 367
fixed async read w/o at_cmd #652
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
Conversation
I don't understand, if at_cmd isn't used then the interrupt isn't enabled, so how would it break things? |
|
Here is what I noticed: [Update]
UartFuture::new(Event::RxCmdCharDetected, self.inner()).await;AT_CMD interrupt is enabled. 2.AT_CMD and FIFO FULL select(
UartFuture::new(Event::RxCmdCharDetected, self.inner()),
UartFuture::new(Event::RxFifoFull, self.inner()),
)
.await;AT_CMD and FIFO FULL interrupt are enabled. However it seems that after I have set correct the rx fifo full threshold for esp32, the issue was solved. |
|
I have found the issue: But the bool parameter for read might not be the best solution. |
I think saving |
Ok. |
Hmm not sure about that. @bjoernQ @jessebraham was there any reason we didn't store the at cmd config in the Uart originally?
I think we just need a check on the esp32 to ensure the passed-in threshold does not exceed the 7bit max on the esp32. |
Don't think there really was a reason for that other than there wasn't a need for it back then |
Ok. I will also check the manuals for esp32c6, esp32h2 there is the same |
Thinking about it. What is someone does not call |
MabezDev
left a comment
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.
Sorry for the delay @alexiionescu, this dropped off my radar for a moment.
MabezDev
left a comment
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.
Thanks! This looks good to go, could you rebase on main to avoid the conflicts please?
* fixed async read w/o at_cmd * configurtion checks for async `read` * remove fifo thrhd check
Found a bug when set_at_cmd was not used.
Somehow the at_cmd interrupt is triggered so often that breaks everything on embassy async.
To fix this I have added an additional parameter on
readfunction towait_at_cmdinterrupt or not. If you have a better suggestion I can implement.While at it, I have also implemented the RxFifo Overflow interrupt and error. It is important when using high speed baud rates to know if your processing is keeping up with the received stream.
Another issue I encounter on esp32 chipset. Using
set_rx_fifo_full_thresholdwith 128 is allowed, but esp32 has only 7 bits for the value. Basically using 128(0x80) is working on esp32c3, but breaks everything on esp32 (triggers rx_fifo_full when 0 bytes are in rx fifo)Not sure how to solve this at compile time, maybe some check at runtime?
I lost a day trying to figure out why the code working on esp32c3 does not work on esp32.
Must
errorsorwarnings.cargo fmtwas run.CHANGELOG.mdin the proper section.Nice to have