Skip to content

[nrf fromlist] drivers: serial: nrfx_uarte: Add mode with TIMER byte counting #3033

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

nordic-krch
Copy link
Contributor

Upstream PR 92767

Copy link

github-actions bot commented Jul 8, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_nordic zephyrproject-rtos/hal_nordic@71308dc (nrfx-3.12.1) zephyrproject-rtos/hal_nordic#306 zephyrproject-rtos/hal_nordic#306/files

DNM label due to: 1 project with PR revision

Note: This message is automatically posted and updated by the Manifest GitHub Action.

aescolar and others added 10 commits July 11, 2025 12:50
…d rng driver

Update with the latest nordic hal which includes an updated
CRACEN driver which supports the 54LM20 and newer devices

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
(cherry picked from commit ce0d65a35c0e0fdd89c7b697708615e09c04c70c)
Update hal_nordic with nrf_uarte change. Add functions for setting
PTR and MAXCNT separately.

Upstream PR #: 92767

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Timer property indicates which TIMER instance should be used for
byte counting. If timer property is present then given instance
is using TIMER to count received bytes.

Upstream PR #: 92767

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Rearrange code to prepare for upcoming extension that adds special
receive mode.

Upstream PR #: 92767

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Add reporting about the test progress. Test lasts few seconds and
progress report helps to see if test stuck or how it is progressing.

Upstream PR #: 92767

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Extend test with a mode where HWFC is off and receiver is providing
buffers on time. In that case receiver should be able to continuously
receive data without losing any byte (even without HWFC). Additionally,
TX data is chopped to verify that receiver does not loose bytes when
new TX data collides with detected RX timeout.

Upstream PR #: 92767

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
… for nrf54l

Add timer property to the uart device under test.
Add zephyr,pm-device-runtime-auto to the uart device under test.

Upstream PR #: 92767

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
…nfiguration

Add workaround timer to instances that are used for reception in the
test.

Upstream PR #: 92767

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
…andling

Stress test is executed on CPUs with slow clock (16MHz). Handling of test
data in UART_RX_RDY event is optimized to reduce time spent in the
interrupt context. Since payload is always a decrementing sequence, fixed
array is used to compare memory which allows to use standard memcmp
instead of byte by byte comparison.

Upstream PR #: 92767

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
…counting

Add mode to be used on UARTE with frame timeout which is using a bounce
buffers and TIMER to count bytes. This mode shall be used to reliably
receive data without HWFC as frame timeout approach is not 100% reliable
because it can loose or corrupt a byte when new byte arrives after
frame timeout is detected but before it is fully handled. This mode is
similar to the one enabled with CONFIG_UART_x_NRF_HW_ASYNC but
additional bounce buffers are used and UARTE is receiving data to
internal buffers and copies data to the user buffer. Legacy apporach
cannot be used because in new SoC DMA attempts to copy data in words
so when byte is received it stays in the DMA internal buffer until
4 bytes are received or end of transfer happens then internal DMA
buffer is flushed.

Upstream PR #: 92767

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
@nordic-krch nordic-krch force-pushed the ncs/uart_byte_count branch from a37e4e1 to 7a30a6c Compare July 11, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants