-
Notifications
You must be signed in to change notification settings - Fork 3k
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
C HAL function to check Serial FIFO status #4408
Comments
@bridadan sounds good to me - problem is clearly exposed. Thx |
@bridadan : any plan for adding the C API that is suggested here ? |
It has been asked few times recently (due to reset of MCU and sleep). We will consider this while reviewing the current serial HAL API. I can't comment on any specific date at the moment. Thanks for bringing this up again. |
As suggested by Russ Butler in mbed-os issue ARMmbed#7328, and until there is an implementation of mbed-os issue ARMmbed#4408, we are implementing a workaround at HAL level to check if there is any ongoing serial transfer (which happens if HW FIFO is not yet empty). In case a transfer is ongoing, we're not entering deep sleep and return immediately.
As suggested by Russ Butler in mbed-os issue #7328, and until there is an implementation of mbed-os issue #4408, we are implementing a workaround at HAL level to check if there is any ongoing serial transfer (which happens if HW FIFO is not yet empty). In case a transfer is ongoing, we're not entering deep sleep and return immediately.
As suggested by Russ Butler in mbed-os issue #7328, and until there is an implementation of mbed-os issue #4408, we are implementing a workaround at HAL level to check if there is any ongoing serial transfer (which happens if HW FIFO is not yet empty). In case a transfer is ongoing, we're not entering deep sleep and return immediately.
As suggested by Russ Butler in mbed-os issue ARMmbed#7328, and until there is an implementation of mbed-os issue ARMmbed#4408, we are implementing a workaround at HAL level to check if there is any ongoing serial transfer (which happens if HW FIFO is not yet empty). In case a transfer is ongoing, we're not entering deep sleep and return immediately.
Internal Jira reference: https://jira.arm.com/browse/IOTHAL-75 |
Any news on this? |
Hello is there any updates here? One additional question: I mean for example the UART has not empty TX buffer and all data in this buffer would be lost if we just enter Deep Sleep (without any additional actions). |
Hmm... @ARMmbed/mbed-os-hal Any updates? @kjbracey-arm might know as well. |
simple example With enable MBED_TICKLESS we have the following code: int main()
So how to avoid situation in #1? Should we update the hal_deepsleep not enter into the Deep Sleep if some HW indicated that it is not yet ready to enter into Deep Sleep. More over, it looks like that greentea tests do not support such graceful low power transitions. I think the following should discussed in a separate thread but lets start from here What if we have 128 bits wide buffer? Can I get a justification about the 20 ms for SERIAL_FLUSH_TIME_MS define? I think it is too much here, but let it be the starting point of discussion. Will continue in whatever thread you tell me to jump. |
Hello, We're planning to improve the UART HAL APIs - this is something we've flagged and take into account. @amak-cy Currently drivers can prevent the MCU to go into deep sleep. |
Related issue: #9770 |
Hello Any updates on this request? |
Thank you for raising this issue. Please note we have updated our policies and |
Description
Enhancement
Reason to enhance or problem with existing solution
When using the Serial API, most implementations take the to-be-transmitted data and place it in the UART hardware's FIFO. At this point the function returns, however there is no way to actually check via the mbed API whether this data has actually been transmitted "on the wire".
Suggested enhancement
It has been suggested in past discussions (#1849, #3132, #2966) to add a C HAL function that would allow applications to check if the FIFO buffer is empty. This would allow applications to ensure all data has been transmitted before doing certain actions that affect the serial hardware (eg. sleep/deepsleep).
Pros
Cons
FYI @LMESTM @0xc0170
The text was updated successfully, but these errors were encountered: