Skip to content

NXP: driver: nxp,kinetis-lpuart: Async API issues at high speed on imxrt1040 series #78291

@matt-wood-ct

Description

@matt-wood-ct

Describe the bug
Background in additional comments to keep this section short.

After chasing issues for a while we went back to basics and loaded up the test/drivers/uart/uart_async_api ZTEST to validate that the IMXRT1040's UART driver is operating well.
We configured it for 1,843,200 baud with loopback enabled on lpuart8 (overlay based on IMXRT EVK overlays) and the test start crashing/failing, we found any baudrate higher then 1,000,000 would fail (see log in log section).

At baud rates below 1 mega baud, the tests pass as expected (testing 460,800 & 700,000 both passed). I don't think the test is supposed to be baud rate sensitive but please tell me if this is normal and not indicative of a driver issue.

To Reproduce

  1. Open tests/drivers/uart/uart_async_api
  2. Add a relevant overlay for a imxrt10xx based board with a high baudrate and loopback enabled
  3. Build and run the test on hardware

Expected behavior
Async and ISR based APIs to both work reliably at any supported baud rate, and the driver tests to pass at any supported baud rate.

Impact
This is preventing us from using the DMA with the IMXRTs UARTs which is causing various issues for us, our inter-processor UART links are unreliable on ISR based UART implementations owing to data overrun issues on data bursts. Additionally on our WS2812 UART based driver we are experiencing occasional LED glitches due to transmission hitching which occurs when the ISR can't keep up.

Logs and console output
Error:

*** Booting Zephyr OS build v3.7.0-2556-g884a4e5a35f3 ***
Running TESTSUITE uart_async_chain_read
===================================================================
E: No buffers to release from RX DMA!
E: No buffers to release from RX DMA!
START - test_chained_read
E: Got error : -5

    Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/uart/uart_async_api/src/test_uart_async.c:348: test_chained_read_callback: rx_data_idx + evt->data.rx.len <= sizeof(chained_cpy_buf) is false

ASSERTION FAIL [0] @ WEST_TOPDIR/zephyr/kernel/sched.c:1430
        aborting essential thread 0x20002908
E: r0/a1:  0x00000004  r1/a2:  0x00000596  r2/a3:  0x40184000
E: r3/a4:  0x00000004 r12/ip:  0x00000000 r14/lr:  0x60009aa7
E:  xpsr:  0x21000000
E: Faulting instruction address (r15/pc): 0x6000bc44
E: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
E: Current thread: 0x20002908 (sysworkq)
E: Halting system

This error seems to imply the test received back more data when it sent implying there is extra bytes coming in or going out.

Environment (please complete the following information):

Additional Notes
During testing of a larger system which uses high speed UARTs we had issues using the UART driver in async mode, after more testing we found that the IMXRT1040 UARTs do not behave reliably at speeds in excess of 400,000 baud. In our example we were driving Neopixels using a UART TX with signal inversion at 8,000,000 baud (which works out as 1 frame per bit on a WS2812B) and we were seeing on the bus the first few transmission bursts had all the data as zero, but when we stepped through the code the transmissions would come out uncorrupted.

Metadata

Metadata

Assignees

Labels

bugThe issue is a bug, or the PR is fixing a bugplatform: NXPNXPpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions