zephyr: mimxrt1170_evk: SPI loopback test fails for flexIO SPI node
Describe the bug
While running the SPI loopback test for the FlexIO SPI on the NXP MIMXRT1170-EVK Evaluation Kit , the test becomes unresponsive and does not complete successfully as shown in the log below.
Since, there is no test case for testing flexio-spi for MIMXRT1170-EVK, I have created the test case, along with the overlay file in my forked repository.
- What target platform are you using?: IMXRT1170 EVK
- What have you tried to diagnose or workaround this issue? Run tests/drivers/spi/spi_loopback on flexio SPI node in IMXRT1170_evk
- Is this a regression?: No
To Reproduce Steps to reproduce the behavior:
- Clone the forked repo
- Checkout branch: git checkout flexio_spi_loopback_test_rt1170
- Connect J10-10 and J10-08 (SDO & SDI) on the MIMXRT1170-EVK Evaluation Kit
- west build -p -b mimxrt1170_evk//cm7 tests/drivers/spi/spi_loopback -T drivers.spi.RT1170_flexio_spi.loopback
- west -v flash
- See serial monitor for the error (Test doesn’t succeed and gets stuck)
Expected behavior
All test cases should pass.
Impact
We require FlexIO SPI for our application.
Logs and console output
Running TESTSUITE spi_loopback
===================================================================
START - test_spi_loopback
I: SPI test on buffers TX/RX 0x800041e0/0x800041c0, frame size = 8
I: SPI test slow config
I: Start complete multiple
[log stuck here]
Environment (please complete the following information):
Zephyr docker image v0.26.13 Zephyr SDK v0.16.8 Commit 494f880
Debugging and Observations:
During debugging, we discovered a temporary workaround: inserting a delay using k_busy_wait(20) within the spi_mcux_flexio_isr() function that allows the tests to pass consistently.
However, this solution is sub-optimal, as busy waiting inside an ISR is generally not recommended.
To test this workaround, the line containing the delay k_busy_wait(20) in the spi_mcux_flexio_isr() function must be uncommented in the forked repository.
This might also be due to a synchronization problem observed when enabling flexio spi for frdm_ke17z in this PR where a separate if condition was added in the spi_mcux_flexio_isr() function.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 15 (9 by maintainers)
Reopening @asingh-GiN , sorry for the delay
I am diving into this issue and the root cause has been located. A PR will be submitted to address this issue very soon. for FlexIO SPI itself, I don’t think they are efficient especially for high band rate until DMA mode is implemented. we can make spi loopback test passed but that does not mean it will work well on you application.
https://github.com/zephyrproject-rtos/zephyr/pull/88877
@dleach02 @asingh-GiN
I also have confirmed this issue on the RT1176. I am guessing it applies to any RT family member.