diff --git a/doc/releases/release-notes-4.2.rst b/doc/releases/release-notes-4.2.rst index dc18753ba626..931a040edd8e 100644 --- a/doc/releases/release-notes-4.2.rst +++ b/doc/releases/release-notes-4.2.rst @@ -1376,3 +1376,9 @@ Other notable changes :ref:`shields` build system feature (``west build --shield``) to interface any connectorized i2c module to any board with a compatible i2c port, regardless of the specific i2c connector branding. + +* Reverted deprecation of receiver option in Nordic UART driver. Receiver mode which is using + additional TIMER peripheral to count received bytes was previously deprecated + (e.g. :kconfig:option:`CONFIG_CONFIG_UART_0_NRF_HW_ASYNC`). However, it turned out that this + previously mode is the only one that is capable of reliably receive data without Hardware + Flow Control so it should stay in the driver. diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index f91980c058b5..647e8cbb2e6f 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -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 diff --git a/drivers/serial/Kconfig.nrfx_uart_instance b/drivers/serial/Kconfig.nrfx_uart_instance index fa93a8144828..b1a68d691c45 100644 --- a/drivers/serial/Kconfig.nrfx_uart_instance +++ b/drivers/serial/Kconfig.nrfx_uart_instance @@ -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 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) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 46c5a8b83d2e..cd8aab9a4753 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -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) diff --git a/samples/net/cellular_modem/boards/nrf9160dk_nrf52840.conf b/samples/net/cellular_modem/boards/nrf9160dk_nrf52840.conf index 226ce728a19a..6cf67ab5f984 100644 --- a/samples/net/cellular_modem/boards/nrf9160dk_nrf52840.conf +++ b/samples/net/cellular_modem/boards/nrf9160dk_nrf52840.conf @@ -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 diff --git a/samples/net/cellular_modem/boards/nrf9160dk_nrf9160_ns.conf b/samples/net/cellular_modem/boards/nrf9160dk_nrf9160_ns.conf index 907cc9baed1f..a3cfb7919db5 100644 --- a/samples/net/cellular_modem/boards/nrf9160dk_nrf9160_ns.conf +++ b/samples/net/cellular_modem/boards/nrf9160dk_nrf9160_ns.conf @@ -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 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf new file mode 100644 index 000000000000..e7a460fde6bb --- /dev/null +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340bsim_nrf5340_cpuapp.conf @@ -0,0 +1,2 @@ +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 +CONFIG_UART_NRFX_UARTE_ENHANCED_RX=y diff --git a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf index d70069646c93..396d23ba5ae3 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -1 +1,3 @@ +CONFIG_UART_1_NRF_HW_ASYNC=y +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT=57600 diff --git a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf index 83e126780f99..4f738f955e10 100644 --- a/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf +++ b/tests/drivers/uart/uart_async_api/boards/nrf9160dk_nrf9160.conf @@ -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 diff --git a/tests/drivers/uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/drivers/uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf new file mode 100644 index 000000000000..025b92361475 --- /dev/null +++ b/tests/drivers/uart/uart_errors/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -0,0 +1,2 @@ +CONFIG_UART_1_NRF_HW_ASYNC=y +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 diff --git a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml index a901abda9e43..1ad54eb0dc5b 100644 --- a/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml +++ b/tests/drivers/uart/uart_mix_fifo_poll/testcase.yaml @@ -78,6 +78,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 diff --git a/tests/drivers/uart/uart_pm/testcase.yaml b/tests/drivers/uart/uart_pm/testcase.yaml index 9bb360677577..8385db6bf866 100644 --- a/tests/drivers/uart/uart_pm/testcase.yaml +++ b/tests/drivers/uart/uart_pm/testcase.yaml @@ -82,6 +82,9 @@ 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: @@ -89,6 +92,9 @@ 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=y platform_exclude: - nrf54l09pdk/nrf54l09/cpuapp