DSPI transfer over DMA fails

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DSPI transfer over DMA fails

2,268 Views
bottleneck
Contributor II

I am using MPC5676R micro, trying to transmit data from SPI A to SPI B. Data transfer between SPI channels are through DMA. But data transaction is not happening via DMA, PUSHR register is got getting updated. Loopback test between cross processor and cross channel is passed without DMA. Any suggestions. Any example code to prove DSPI transfer using DMA. Please do needful.

0 Kudos
14 Replies

1,727 Views
bottleneck
Contributor II

Hi Lukas,

I have progressed with the example, but now I have the performance issue with DMA. I am supposed to transfer 3746 bytes from Master DSPI A channel to Slave DSPI B Channel in multi transfer mode. But the data is TXFIFO is not been completely received by RXFIFO. If you have any proven code to transfer more than 2K bytes in multi transfer over DMA, it would be helpful. On a overview the Data transfer is shown below for your understanding,

Application --> DMA buffer(DMA) --> TXBUF(DMA)-->TXFIFO (DSPI_A) ===> DSPI_B(RXFIFO)(DMA) --> Application

Please do needful, as it is emergency to resolve the issue.

0 Kudos

1,727 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I can't see any problem if you need to send more data. If you are able to transfer small block of data but not the larger one then I would try to decrease the SPI frequency to see if it is caused by some noise on SPI bus. Have you checked by oscilloscope if the data are sent by the master? Is it possible that it is caused by slave? This would require some extensive debugging...

Regards,

Lukas

0 Kudos

1,727 Views
bottleneck
Contributor II

One more observation, I have derived the register values from your code , but the able to see the data on TXFIFO and count is getting incremented on SPI A channel. But on SPI B channel no count value is seen and no data on POP register. Bit confused further where to observe and make SPI working. Please suggest.

0 Kudos

1,727 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Can you share some simple project to see your configuration? Sorry but I'm quite busy to write some SW example.

Regards,

Lukas

0 Kudos

1,727 Views
bottleneck
Contributor II

Hi,

I get data from via DMA and put it on Spi A channel which acts as a master

and always transmits and SPI B channel acts as slave and always receives

data from tx fifo of channel A. Now I get data till tx fifo and count

getting updated and on rx side I don't see anything updated. Please share

your register configuration for spi A and B with DMA.

PFA configuration for reference. Please suggest.

0 Kudos

1,727 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I do not understand from your description if there's a problem only with DMA or with the slave SPI module. Are you able to send/receive data from SPI B when not using DMA?

There's simple example for DSPI master/slave in AN2865:

http://www.nxp.com/files/32bit/doc/app_note/AN2865.pdf

http://www.nxp.com/webapp/sps/download/license.jsp?colCode=AN2865SW

It's not directly for MPC5676R but it could help...

Regards,

Lukas

0 Kudos

1,727 Views
bottleneck
Contributor II

Hi,

I had a walk through on the links you shared to me. What is the reason DSPI

A is not used, either transfer is done between B&C or C&D

0 Kudos

1,727 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I have uploaded example here:

https://community.nxp.com/docs/DOC-334012 

Regards,

Lukas

0 Kudos

1,727 Views
bottleneck
Contributor II

Hi Lukas,

I have progressed with the example, but now I have the performance issue with DMA. I am supposed to transfer 3746 bytes from Master DSPI A channel to Slave DSPI B Channel in multi transfer mode. But the data is TXFIFO is not been completely received by RXFIFO. If you have any proven code to transfer more than 2K bytes in multi transfer over DMA, it would be helpful. On a overview the Data transfer is shown below for your understanding,

 

Application --> DMA buffer(DMA) --> TXBUF(DMA)-->TXFIFO (DSPI_A) ===> DSPI_B(RXFIFO)(DMA) --> Application

 

Please do needful, as it is emergency to resolve the issue.

0 Kudos

1,727 Views
bottleneck
Contributor II

Hi Lukas,

The screenshot I shared is the configuration done for SPI channel A and B.

Without DMA I am able to transfer from channel A to B. It would be helpful

if I get sample code for MPC5676R with SPI-DMA to directly test on my

target.

0 Kudos

1,727 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Attachment...

0 Kudos

1,727 Views
bottleneck
Contributor II

I am using 180 Mhz cpu clock with 40Mhz crystal, please suggest. My SPI

transfer is not happening and SPI is made to function as half duplex i. e.,

Spi A used to transmit and B used to receive alone. Please suggest

0 Kudos

1,727 Views
bottleneck
Contributor II

I need a quick help, for data transaction I using EDMA channel B 15 and for CRC checking Channel 47. Can you help me in configuring the necessary registers, earlier atleast I was able to see data in TXFIFO after updating the channel numbers in RSER, SERQR, ERQRL and ERQRH for channel 15 and 47 but unable to see data in DMA memory and TXFIFO. Can you help me in configuring correctly for DMA section. Please do needful

0 Kudos

1,727 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I have SW example for MPC5674F which is very similar. See please attachment.

Regards,

Lukas

0 Kudos