Skip to content

drivers: serial: nrf_sw_lpuart: Fix case of flushing RX FIFO - #27571

Merged
rlubos merged 1 commit into
nrfconnect:mainfrom
nordic-krch:lpuart_int_fix
May 26, 2026
Merged

drivers: serial: nrf_sw_lpuart: Fix case of flushing RX FIFO#27571
rlubos merged 1 commit into
nrfconnect:mainfrom
nordic-krch:lpuart_int_fix

Conversation

@nordic-krch

Copy link
Copy Markdown
Contributor

In Bluetooth HCI there is a case where uart_fifo_read is called not from the UART interrupt context. If that happens and there is pending UART that then LPUART was not able to reset the receiver. Case like that happend when HCI device sends data to the host core after host core got reset but before HCI device is reset by the host. Calling uart_fifo_read not from UART interrupt handler is a violation of the API but it has been used like that to drain UART FIFO for years and it has been useful so LPUART adapts to it.

@nordic-krch
nordic-krch requested a review from a team as a code owner March 18, 2026 06:21
@NordicBuilder

NordicBuilder commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

CI Information

To view the history of this post, click the 'edited' button above
Build number: 5

Inputs:

Sources:

sdk-nrf: PR head: 54774d3ab30009f63b567f37af8c6ad599266e4b

more details

sdk-nrf:

PR head: 54774d3ab30009f63b567f37af8c6ad599266e4b
merge base: ddd4dccdf0f3d8722062d3c0c7c4f2c7634cbd4b
target head (main): ddd4dccdf0f3d8722062d3c0c7c4f2c7634cbd4b
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (2)
doc
│  ├── nrf
│  │  ├── releases_and_maturity
│  │  │  ├── releases
│  │  │  │  │ release-notes-changelog.rst
drivers
│  ├── serial
│  │  │ uart_nrf_sw_lpuart.c

Outputs:

Toolchain

Version: 53ac68dd62
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:53ac68dd62_5ea73affbf

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 36
  • ✅ Integration tests
Disabled integration tests
    • test-fw-nrfconnect-nrf_lrcs_mosh
    • test-fw-nrfconnect-nrf_lrcs_positioning
    • desktop52_verification
    • test_ble_nrf_config
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-ps-main
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-thread-main
    • test-low-level
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-sdk-wifi

Note: This message is automatically posted and updated by the CI

@nordic-krch
nordic-krch requested a review from a team as a code owner March 25, 2026 15:02
@NordicBuilder NordicBuilder added doc-required PR must not be merged without tech writer approval. changelog labels Mar 25, 2026
@github-actions

Copy link
Copy Markdown

You can find the documentation preview for this PR here.

Preview links for modified nRF Connect SDK documents:

https://ncsbmdoc.z6.web.core.windows.net/ncs/PR-27571/nrf/releases_and_maturity/releases/release-notes-changelog.html

@FrancescoSer FrancescoSer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving but please implement this small suggestion

Comment thread doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst Outdated
@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 7 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions Bot added the Stale label Apr 29, 2026
In Bluetooth HCI there is a case where uart_fifo_read is called
not from the UART interrupt context. If that happens and there is
pending UART data then LPUART was not able to reset the receiver
as it remained in the blocked state.

Case like that happens when HCI device sends data to the host core
after host core got reset but before HCI device is reset by the
host. Calling uart_fifo_read not from UART interrupt handler is a
violation of the API but it has been used like that to drain
UART FIFO for years and it has been useful so LPUART adapts to
it.

Case is fixed by triggering the UART interrupt if receiver is in
blocked state.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
@nordic-krch nordic-krch added bug backwards-compatible PR doesnt break code, Kconfig, or DTS. I.e no changes needed for customers to port their application and removed Stale labels Apr 29, 2026
@nordic-krch nordic-krch added this to the 3.4.0 milestone Apr 29, 2026
@rlubos
rlubos merged commit 81f37c1 into nrfconnect:main May 26, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards-compatible PR doesnt break code, Kconfig, or DTS. I.e no changes needed for customers to port their application changelog doc-required PR must not be merged without tech writer approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants