Hello,
The chip select is always LOW after we send out the first command, it couldn't be in LOW but must be in HIGH (deactivate state), after finish transmission (in this case, after send the 10 bytes):
I'm using this configuration:
I'm using DMA to TX and RX. The DMA callbacks works well.
I'm using as well this function to transfer data:
Lpspi_Ip_AsyncTransmit();
In Lpspi_Ip_UpdateTransferMode I set with LPSPI_IP_INTERRUPT.
Thanks
已解决! 转到解答。
I haven't noticed but RTD expert found it out. You have a mistake in your configuration.
As LPSPI instance is 0 so you should put Lpspi_Ip_LPSPI_0_IrqTxDmaHandler in DMA interrupt callback:
Attached modified project.
I debugged the code, when we used DMA, the chip select is always LOW (active state):
Must I use these callbacks in "IntCtrl_Ip_InstallHandler"? The callback "Dma0_Ch1_IRQHandler" have never changed the Chip Select state, but this function notify that the buffer of DMA about SPI is ok and I can use it.
Another information. When I use simple ISR (the callback "Lpspi_Ip_LPSPI_0_IRQHandler"), the Chip select works according, but I would like to use DMA and not ISR. I saw also I can't use both together.
So, summarize, when I use DMA, there is this problem. The sending, receiving and notify callback of DMA are working well, but the chip select is not working.
I'm using this function to send message:
Could you send me the whole project? I mean the whole example how you have configured it showing mentioned behavior. I will try to debug it or report to software developers if needed. Thanks
Hello @davidtosenovjan
Follow the zip with problem using DMA.
We can see in this code, one example of sending 10 bytes of SPI using DMA, result:
If we test this code without DMA:
We get this result:
Thanks!
I just played with this code for quite long time but I haven't found anything wrong.
I guess there is an issue with RTD driver. I will report it and we will see. I will return to you.
Ok, but which callback should I use as user callback? Because this "Lpspi_Ip_LPSPI_0_IrqTxDmaHandler" is not available to user, right? I would like to use this callback to do some things.
This "Lpspi_Ip_LPSPI_2_IrqTxDmaHandler" that I defined could be any name, because I'm considering it as an user callback.
Thanks.
Anyway, at first I would recommend to see following threads:
https://community.nxp.com/t5/S32K/S32K14x-Command-Word-in-LPSPI/td-p/1040779