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.96k stars 6.68k forks source link

SPI: NRF52DK/NRF52832 fails spi_controller_peripheral tests #77615

Open matt-wood-ct opened 3 months ago

matt-wood-ct commented 3 months ago

Describe the bug I'm investigating an issue using SPI between an IMXRT and NRF52 MCUs and as part of that I went back to basics and was validating the SPI peripherals behaviours on both ICs, to do this I ran the tests/drivers/spi/spi_controller_peripheral test on both MCUs and I got this strange result on the NRF

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

SUITE FAIL -  50.00% [spi_controller_peripheral]: pass = 5, fail = 5, skip = 4, total = 14 duration = 0.198 seconds
 - PASS - [spi_controller_peripheral.test_basic] duration = 0.011 seconds
 - FAIL - [spi_controller_peripheral.test_basic_async] duration = 0.026 seconds
 - PASS - [spi_controller_peripheral.test_basic_zero_len] duration = 0.011 seconds
 - FAIL - [spi_controller_peripheral.test_basic_zero_len_async] duration = 0.026 seconds
 - PASS - [spi_controller_peripheral.test_only_rx] duration = 0.011 seconds
 - FAIL - [spi_controller_peripheral.test_only_rx_async] duration = 0.023 seconds
 - SKIP - [spi_controller_peripheral.test_only_rx_in_chunks] duration = 0.004 seconds
 - SKIP - [spi_controller_peripheral.test_only_rx_in_chunks_async] duration = 0.004 seconds
 - PASS - [spi_controller_peripheral.test_only_tx] duration = 0.011 seconds
 - FAIL - [spi_controller_peripheral.test_only_tx_async] duration = 0.026 seconds
 - SKIP - [spi_controller_peripheral.test_only_tx_in_chunks] duration = 0.004 seconds
 - SKIP - [spi_controller_peripheral.test_only_tx_in_chunks_async] duration = 0.004 seconds
 - PASS - [spi_controller_peripheral.test_short_rx] duration = 0.011 seconds
 - FAIL - [spi_controller_peripheral.test_short_rx_async] duration = 0.026 seconds

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

It seems like all the Async tests fail on this platform, is this right?

To Reproduce Setup a dev kit with some loop back jumpers from

With the attached overlay file nrf52dk_nrf52832.overlay.txt

Build and run

Expected behavior Full set of passes

Impact Unclear, may be unrelated or may be the cause of my issues

Logs and console output Full output:

Full log ``` *** Booting Zephyr OS build v3.7.0-1712-geaf92a1494cc *** Running TESTSUITE spi_controller_peripheral =================================================================== START - test_basic PASS - test_basic in 0.011 seconds =================================================================== START - test_basic_async Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/spi/spi_controller_peripheral/src/main.c:253: run_test: (periph_rv not equal to srx_len) Got: 0 but expected:16 FAIL - test_basic_async in 0.026 seconds =================================================================== START - test_basic_zero_len PASS - test_basic_zero_len in 0.011 seconds =================================================================== START - test_basic_zero_len_async Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/spi/spi_controller_peripheral/src/main.c:253: run_test: (periph_rv not equal to srx_len) Got: 0 but expected:8 FAIL - test_basic_zero_len_async in 0.026 seconds =================================================================== START - test_only_rx PASS - test_only_rx in 0.011 seconds =================================================================== START - test_only_rx_async Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/spi/spi_controller_peripheral/src/main.c:259: run_test: rv not equal to 0 FAIL - test_only_rx_async in 0.023 seconds =================================================================== START - test_only_rx_in_chunks E: Scattered buffers are not supported SKIP - test_only_rx_in_chunks in 0.004 seconds =================================================================== START - test_only_rx_in_chunks_async E: Scattered buffers are not supported SKIP - test_only_rx_in_chunks_async in 0.004 seconds =================================================================== START - test_only_tx PASS - test_only_tx in 0.011 seconds =================================================================== START - test_only_tx_async Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/spi/spi_controller_peripheral/src/main.c:253: run_test: (periph_rv not equal to srx_len) Got: 0 but expected:16 FAIL - test_only_tx_async in 0.026 seconds =================================================================== START - test_only_tx_in_chunks E: Scattered buffers are not supported SKIP - test_only_tx_in_chunks in 0.004 seconds =================================================================== START - test_only_tx_in_chunks_async E: Scattered buffers are not supported SKIP - test_only_tx_in_chunks_async in 0.004 seconds =================================================================== START - test_short_rx PASS - test_short_rx in 0.011 seconds =================================================================== START - test_short_rx_async Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/spi/spi_controller_peripheral/src/main.c:253: run_test: (periph_rv not equal to srx_len) Got: 0 but expected:12 FAIL - test_short_rx_async in 0.026 seconds =================================================================== TESTSUITE spi_controller_peripheral failed. ------ TESTSUITE SUMMARY START ------ SUITE FAIL - 50.00% [spi_controller_peripheral]: pass = 5, fail = 5, skip = 4, total = 14 duration = 0.198 seconds - PASS - [spi_controller_peripheral.test_basic] duration = 0.011 seconds - FAIL - [spi_controller_peripheral.test_basic_async] duration = 0.026 seconds - PASS - [spi_controller_peripheral.test_basic_zero_len] duration = 0.011 seconds - FAIL - [spi_controller_peripheral.test_basic_zero_len_async] duration = 0.026 seconds - PASS - [spi_controller_peripheral.test_only_rx] duration = 0.011 seconds - FAIL - [spi_controller_peripheral.test_only_rx_async] duration = 0.023 seconds - SKIP - [spi_controller_peripheral.test_only_rx_in_chunks] duration = 0.004 seconds - SKIP - [spi_controller_peripheral.test_only_rx_in_chunks_async] duration = 0.004 seconds - PASS - [spi_controller_peripheral.test_only_tx] duration = 0.011 seconds - FAIL - [spi_controller_peripheral.test_only_tx_async] duration = 0.026 seconds - SKIP - [spi_controller_peripheral.test_only_tx_in_chunks] duration = 0.004 seconds - SKIP - [spi_controller_peripheral.test_only_tx_in_chunks_async] duration = 0.004 seconds - PASS - [spi_controller_peripheral.test_short_rx] duration = 0.011 seconds - FAIL - [spi_controller_peripheral.test_short_rx_async] duration = 0.026 seconds ------ TESTSUITE SUMMARY END ------ =================================================================== PROJECT EXECUTION FAILED ```

Environment (please complete the following information):

nordicjm commented 3 months ago

@bjarki-andreasen aren't you doing something around this?

bjarki-andreasen commented 3 months ago

@nordicjm no :)

nordic-piks commented 2 months ago

Triaged internally

github-actions[bot] commented 2 weeks ago

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