Skip to content

Revert "drivers: serial: nrfx_uarte: Deprecate CONFIG_UART_x_NRF_HW_A… #92156

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 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/serial/Kconfig.nrfx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ config UART_NRFX_UARTE_ENHANCED_RX
bool "Enhanced RX handling"
depends on UART_ASYNC_API
depends on UART_NRFX_UARTE_LEGACY_SHIM
depends on !(UART_0_NRF_HW_ASYNC || UART_1_NRF_HW_ASYNC || UART_2_NRF_HW_ASYNC)
default y
help
Enable RX handling mode which is switching buffers on timeout. This is an
Expand Down
7 changes: 1 addition & 6 deletions drivers/serial/Kconfig.nrfx_uart_instance
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,18 @@ config UART_$(nrfx_uart_num)_NRF_TX_BUFFER_SIZE
particular SoC.

config UART_$(nrfx_uart_num)_NRF_HW_ASYNC
bool "[DEPRECATED] Use hardware RX byte counting"
bool "Use hardware RX byte counting"
depends on HAS_HW_NRF_UARTE$(nrfx_uart_num)
depends on UART_ASYNC_API
depends on UART_NRFX_UARTE_LEGACY_SHIM
depends on !UART_NRFX_UARTE_ENHANCED_RX
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be kept?

depends on HAS_HW_NRF_PPI || HAS_HW_NRF_DPPIC
select NRFX_GPPI
select DEPRECATED
help
If default driver uses interrupts to count incoming bytes, it is possible
that with higher speeds and/or high cpu load some data can be lost.
It is recommended to use hardware byte counting in such scenarios.
Hardware RX byte counting requires timer instance and one PPI channel.

This options is deprecated. Use UART_NRFX_UARTE_ENHANCED_RX which supports
reliable byte counting without additional HW resources (TIMER and (D)PPI).

config UART_$(nrfx_uart_num)_NRF_ASYNC_LOW_POWER
bool "Low power mode"
depends on HAS_HW_NRF_UARTE$(nrfx_uart_num)
Expand Down
8 changes: 4 additions & 4 deletions drivers/serial/uart_nrfx_uarte.c
Original file line number Diff line number Diff line change
Expand Up @@ -1611,11 +1611,11 @@ static void endrx_isr(const struct device *dev)
}

irq_unlock(key);
if (IS_ENABLED(UARTE_HAS_FRAME_TIMEOUT)) {
if (start_timeout && !K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) {
k_timer_start(&async_rx->timer, async_rx->timeout, K_NO_WAIT);
}
#ifdef UARTE_HAS_FRAME_TIMEOUT
if (start_timeout && !K_TIMEOUT_EQ(async_rx->timeout, K_NO_WAIT)) {
k_timer_start(&async_rx->timer, async_rx->timeout, K_NO_WAIT);
}
#endif
}

#if !defined(CONFIG_UART_NRFX_UARTE_ENHANCED_RX)
Expand Down
3 changes: 3 additions & 0 deletions samples/net/cellular_modem/boards/nrf9160dk_nrf52840.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
CONFIG_UART_ASYNC_API=y
CONFIG_UART_1_ASYNC=y
CONFIG_UART_1_INTERRUPT_DRIVEN=n
# Enable HW RX byte counting. This especially matters at higher baud rates.
CONFIG_UART_1_NRF_HW_ASYNC=y
CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1

# Align with the Serial LTE Modem (SLM) application.
CONFIG_MODEM_CELLULAR_UART_BUFFER_SIZES=6000
Expand Down
3 changes: 3 additions & 0 deletions samples/net/cellular_modem/boards/nrf9160dk_nrf9160_ns.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
CONFIG_UART_ASYNC_API=y
CONFIG_UART_1_ASYNC=y
CONFIG_UART_1_INTERRUPT_DRIVEN=n
# Enable HW RX byte counting. This especially matters at higher baud rates.
CONFIG_UART_1_NRF_HW_ASYNC=y
CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1

# Align with the Serial LTE Modem (SLM) application.
CONFIG_MODEM_CELLULAR_UART_BUFFER_SIZES=6000
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1
CONFIG_UART_NRFX_UARTE_ENHANCED_RX=y
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600
CONFIG_UART_1_NRF_HW_ASYNC=y
CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
CONFIG_ARM_MPU=n
CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600
CONFIG_UART_1_NRF_HW_ASYNC=y
CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_UART_1_NRF_HW_ASYNC=y
CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1
3 changes: 3 additions & 0 deletions tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ tests:
- CONFIG_UART_0_INTERRUPT_DRIVEN=n
- CONFIG_UART_0_ASYNC=y
- CONFIG_UART_0_ENHANCED_POLL_OUT=y
- CONFIG_UART_0_NRF_HW_ASYNC=y
- CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2
- CONFIG_NRFX_TIMER2=y
platform_allow:
- nrf52840dk/nrf52840
- nrf5340dk/nrf5340/cpuapp
Expand Down
6 changes: 6 additions & 0 deletions tests/drivers/uart/uart_pm/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@ tests:
- CONFIG_UART_INTERRUPT_DRIVEN=n
- CONFIG_UART_ASYNC_API=y
- CONFIG_UART_0_ASYNC=y
- CONFIG_UART_0_NRF_HW_ASYNC=y
- CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2
- CONFIG_NRFX_TIMER2=y
- CONFIG_UART_0_ENHANCED_POLL_OUT=n

drivers.uart.pm.async.enhanced_poll:
extra_configs:
- CONFIG_UART_INTERRUPT_DRIVEN=n
- CONFIG_UART_ASYNC_API=y
- CONFIG_UART_0_ASYNC=y
- CONFIG_UART_0_NRF_HW_ASYNC=y
- CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2
- CONFIG_NRFX_TIMER2=y
- CONFIG_UART_0_ENHANCED_POLL_OUT=y
platform_exclude:
- nrf54l09pdk/nrf54l09/cpuapp
Expand Down