Replies: 8 comments 23 replies
-
Yes, the PR you linked was a hotfix so that the lpspi dma worked at all on RT, it effectively reverted the previous fix of the CS. Now that fix only applies to the MCXN, since that's actually the platform I was developing on when I made that fix. It turns out the lpspi on RT and MCX work significantly differently in regards to when the receiver writes to the RX fifo |
Beta Was this translation helpful? Give feedback.
-
Hi @ofirshe , As for workarounds, you have shared in the past that you had the LPSPI functional. Does reverting the driver back to that previous version work for you? Or, you are currently using a GPIO pin to control the chip select. Could you control that GPIO pin from your application instead of from the driver, and keep it asserted through the whole transfer? Best regards |
Beta Was this translation helpful? Give feedback.
-
Hi @ofirshe , Best regards |
Beta Was this translation helpful? Give feedback.
-
Using GPIO as @DerekSnell will solve the issue. |
Beta Was this translation helpful? Give feedback.
-
Hi @ofirshe and @tbursztyka , However, I get different results when testing this. With I tested with the attached project LPSPI_cs-gpio.zip, which uses your buffer configuration. I tested this with the latest Zephyr release v4.0.0, on the board When I remove And if I enable DMA with the hardware CS, CS gets an additional pulse. So my captures seem consistent with the known issues in the LPSPI driver, which NXP resolved on the MCX N platform, and is working to resolve on the RT platforms. @ofirshe , can you share captures showing the difference between |
Beta Was this translation helpful? Give feedback.
-
Hey @DerekSnell, My Zephyr is aligned with commit hash c50777a, which includes the most recent change to this driver (92d0287). I’m currently running in non-DMA mode (only Here’s what I’ve observed: When the buffer sizes are not equal, using the same code as in your example, the Chip Select (CS) is deasserted during the transaction. However, when the buffer sizes are equal, as in this example: GitHub Discussion Link, I get the expected behavior, with the CS remaining asserted. Let me know if you need further details or clarification. |
Beta Was this translation helpful? Give feedback.
-
Yes, @ofirshe But my request was for you to provide captures with and without using Cheers |
Beta Was this translation helpful? Give feedback.
-
@ofirshe , the To help clarify, here are details based on the LPSPI_cs-gpio.zip example I attached above. This example was written for the MIMXRT1170-EVK board using LPSPI1. Below is the overlay file to configure LPSPI1 to use the GPIO signal as the chip select with the
Next I modify the overlay to use the LPSPI hardware CS signal. Remove the
Next I replicate the setting I believe you were using, which is not configured properly for GPIO CS. The
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I've rebased my Zephyr codebase to include the latest fix by @decsny for the LPSPI driver (drivers: spi_mcux_lpspi: Fix DMA path on RT). However, I’m observing similar symptoms in both DMA and non-DMA modes, even when using the
cs-gpios
workaround (as the CS is currently not working in the non-DMA path).Here’s the code I’m using for the transaction:
SPI configured mode:
SPI_WORD_SET(8) | SPI_OP_MODE_MASTER | SPI_TRANSFER_MSB
Apart from an issue with the component on the MISO line (which I'm troubleshooting separately), I notice that the CS line does not remain asserted until the device completes its response. This issue occurs in both DMA and non-DMA modes, while I would expect CS to stay asserted for the entire transaction.
Best Regards,
Ofir.
Beta Was this translation helpful? Give feedback.
All reactions