zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.91k stars 6.64k forks source link

drivers: NXP LPSPI Async API broken #74907

Open decsny opened 4 months ago

decsny commented 4 months ago

Tracking issue for what appears to be broken support for CONFIG_SPI_ASYNC in the lpspi driver.

west build -b mimxrt1024_evk -p always tests/drivers/spi/spi_loopback -DCONFIG_SPI_ASYNC=y

SPI_ASYNC is enabled by default for the spi_loopback test except that someone has apparently added kconfig overlays to disable testing of the spi async api and disable this symbol for platforms with an LPSPI.

*** Booting Zephyr OS build v3.7.0-rc1-313-g895f246227e2 ***
Running TESTSUITE spi_loopback
===================================================================
START - test_spi_loopback
I: SPI test on buffers TX/RX 0x800040a0/0x80004080, frame size = 8, DMA enabled
I: SPI test slow config
I: Start complete multiple
I: Passed
I: Start complete loop
I: Passed
I: Start null tx
I: Passed
I: Start half start
I: Passed
I: Start half end
I: Passed
I: Start every 4
I: Passed
I: Start rx bigger than tx
I: Passed
I: Start complete large transfers
I: Passed
I: Start async call
E: Buffer 2 contents are different: 0x54,0x68,0x65,0x71,0x75,0x69,0x63,0x6b,0x62,0x72,0x6f,0x77,0x6e,0x66,0x6f,0x78,0x6a,0x75,0x6d,0x70,0x73,0x6f,0x76,0x65,0x72,0x74,0x68,0x65,0x6c,0x61,0x7a,0x79,0x64,0x6f,0x67,
0x00,
E:                              vs: 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,

    Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/spi/spi_loopback/src/spi.c:682: spi_async_call: (1 is true)
Buffer 2 contents are different
 FAIL - test_spi_loopback in 0.221 seconds
===================================================================
TESTSUITE spi_loopback failed.

------ TESTSUITE SUMMARY START ------

SUITE FAIL -   0.00% [spi_loopback]: pass = 0, fail = 1, skip = 0, total = 1 duration = 0.221 seconds
 - FAIL - [spi_loopback.test_spi_loopback] duration = 0.221 seconds

------ TESTSUITE SUMMARY END ------

===================================================================
PROJECT EXECUTION FAILED

    Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/spi/spi_loopback/src/spi.c:592: spi_async_call_cb: (ret is true)
one or more events are not ready
 ERROR: cannot fail in test phase 'teardown()', bailing

    Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/spi/spi_loopback/src/spi.c:592: spi_async_call_cb: (ret is true)
one or more events are not ready
 ERROR: cannot fail in test phase 'teardown()', bailing

    Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/spi/spi_loopback/src/spi.c:592: spi_async_call_cb: (ret is true)
one or more events are not ready
 ERROR: cannot fail in test phase 'teardown()', bailing
manuargue commented 3 months ago

This is also failing for mr_canhubk3 board, only when used together with DMA: west build -p -b mr_canhubk3 tests/drivers/spi/spi_loopback -T drivers.spi.loopback.lpspi.dma

Changing to priority medium as there are apparently many NXP boards affected by this issue. @decsny feel free to lower it if you consider appropriate.