Dear all:
I had a problem with using spi's dma mode for host and slave communication. I did not use the SDK, but programmed it directly by reading and writing registers . In the following code, I tried to use s32k116 that was set as a slave device to communicate with the external spi host device,however, While the host keeps sending 128 bytes of data, the slave DMA receive interrupt could be triggered and receive data from the host, however, the oscilloscope found that the output pin from the slave machine shows no waveform, In other words, DMA transmiting of slave failed.could you help me find out where the problem is? Thank you very much.
What's more, Whether LPSPI slaves support sending DMA messages or not was still confusing me, But I was following the manual of S32K-RM.
According to my understanding, Data from the array of TCD1_Send was transmitted to the register of LPSPI0 - > TDR in the channel 1 of DMA .And in fact, the channel is sent with receiving channel under one same clock, so when receiving channel 0 transmission complete interruption was trigged, channel 1 send has been completed as well. However, I don't see any output data sent from the pin during this period.
Hello vanaua@163.com,
I just quickly tested your code and there is a configuration error in the DMA ch0.
BR, Daniel
Hi, Thank you for your reply. I found that there was a error with the code I uploaded earlier. Such as
DMA->TCD[0].SADDR = DMA_TCD_SADDR_SADDR(&(LPSPI0->RDR)); /* Source Address. */
and the other.(the red is correct)
I have changed it to be more perfect. However, slave's LPSPI communication with DMA can only receive data, but cannot send data. I can not figure out what kind of BUG cause this error.
Hi vanaua@163.com,
You didn't enabled peripheral request for DMA Ch1, you enabled DMA Ch0 only (SERQ).
Do you measure the correct pin?
In the project, you commented that MISO is PTD16 but it is PB4.
Do you use your own board or an EVB?
BR, Daniel