uart: nrfx_uarte: drivers/serial/uart_nrfx_uarte.c: uarte_nrfx_isr_int
disables uarte TXSTOPPED if PM_DEVICE_RUNTIME enabled during interrupt driven output
#91387
Labels
bug
The issue is a bug, or the PR is fixing a bug
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Interrupt driven UART output fails when using nRF UARTE in v4.0 if CONFIG_PM_DEVICE_RUNTIME is enabled while not using low power mode for the UART.
Platform: nRF, such as nRF52840DK
I've narrowed it down to a specific set of changes from a specific commit: 3ce19da
https://github.com/zephyrproject-rtos/zephyr/aabd3a1826d750f2ae4b271894837a91f42186bc/drivers/serial/uart_nrfx_uarte.c#L351-L372
zephyr/drivers/serial/uart_nrfx_uarte.c
Lines 343 to 364 in 3ce19da
Prior to this commit, this conditional branch only executes
nrf_uarte_disable
after a TxStopped event if the UART was configured for low power.Now this conditional branch also executes
nrf_uarte_disable
on line 358 after a TxStopped event if CONFIG_PM_DEVICE_RUNTIME is enabled while transmit is NOT polling based. This breaks the prior interrupt based transmit behaviour where a user could use their interrupt driven callback to load data into the uart fifo after each TxStopped event without the uarte unexpectedly being disabled.The commit originally introducing that
nrf_uarte_disable
call (f075fee) talks about adding low power mode for the uarte peripheral, so I believe the intent is that it is only called if the uart is actually configured for low power mode, not as a side effect of CONFIG_PM_DEVICE_RUNTIME=y plus using interrupt driven transmit.By the same logic, the nrf_uarte_int_disable section highlighted below might be unintentionally called, but it would be easy to workaround by re-enabling the tx irq from the user uart irq callback.
zephyr/drivers/serial/uart_nrfx_uarte.c
Lines 356 to 361 in 3ce19da
Suggested fix:
Add a condition to 'else' branch requiring LOW_POWER_ENABLED(config), so that as originally intended it is only called after the TXSTOPPED event if the uart is configured for low power.
Regression
Steps to reproduce
Reproduction notes:
compatible = "nordic,nrf-uarte"
and doesn't have low-power-enableRelevant log output
Impact
Major – Severely degrades functionality; workaround is difficult or unavailable.
Environment
OS: Windows
Toolchain: Zephyr 4.0
Additional Context
nRF family target,
uarte peripheral enabled, (compatible = "nordic,nrf-uarte"), without low power enabled
config enabling CONFIG_PM_DEVICE_RUNTIME and CONFIG_UART_INTERRUPT_DRIVEN
The text was updated successfully, but these errors were encountered: