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
Modem backend uart async optimization #65194
Merged
carlescufi
merged 4 commits into
zephyrproject-rtos:main
from
bjarki-trackunit:modem_backend_uart_async_optimize
Nov 20, 2023
Merged
Modem backend uart async optimization #65194
carlescufi
merged 4 commits into
zephyrproject-rtos:main
from
bjarki-trackunit:modem_backend_uart_async_optimize
Nov 20, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The current implementation only waits for the RX disabled event to determine if the UART is closed. It should wait for all RX buffers to be released, and the TX to be done as well. We now also call uart_tx_abort() when closing the pipe. Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
bjarki-trackunit
changed the title
Modem backend uart async optimize
Modem backend uart async optimization
Nov 14, 2023
bjarki-trackunit
force-pushed
the
modem_backend_uart_async_optimize
branch
4 times, most recently
from
November 16, 2023 19:37
8c3b4de
to
c084e12
Compare
bjarki-trackunit
requested review from
fabiobaltieri,
jukkar,
ycsin and
rerickson1
November 16, 2023 20:15
bjarki-trackunit
force-pushed
the
modem_backend_uart_async_optimize
branch
from
November 16, 2023 20:19
c084e12
to
ea54712
Compare
rerickson1
requested changes
Nov 16, 2023
tests/subsys/modem/backends/uart/boards/nrf5340dk_nrf5340_cpuapp.overlay
Outdated
Show resolved
Hide resolved
Use single ring buffer and protect it with a spinlock as it is shared between backend and UART thread (ISR). This is simpler than the double ring buffer setup. The receive idle timeout has also been made configurable instead of being a hardcoded value. Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
The UART flush is not relevant for the async UART implementation. UART drivers should handle this internally. Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
bjarki-trackunit
force-pushed
the
modem_backend_uart_async_optimize
branch
from
November 18, 2023 10:07
ea54712
to
4884d04
Compare
The UART backend test suite performs 9 iterations of: 1. Open UART backend pipe 2. Transmit 8192 bytes of pseudo random data 3. Receive and validate bytes 4. close UART backend pipe The test is run on real hardware, with the TX/RX pins connected to each other to provide loopback functionality. The test suite has been run on a STM32 and an nRF5340 board. The test suite tests both the UART interrupt driven and async APIs. Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
bjarki-trackunit
force-pushed
the
modem_backend_uart_async_optimize
branch
from
November 18, 2023 10:12
4884d04
to
ba4674d
Compare
rerickson1
approved these changes
Nov 18, 2023
fabiobaltieri
approved these changes
Nov 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The mode UART backend implementations have been manually tested ad-hoc up until now. This PR adds a proper test suite to stress test the backends on real hardware, along with patches to the backends fixing issues found by the new tests :)
The patches to the backends are listed here, and have their own commits in this PR: