Quantcast
Channel: Processors
Viewing all articles
Browse latest Browse all 123537

Forum Post: Some problems with DM368 transfers data via SPI use DMA

$
0
0

Hi,

   I am works on DM368. Now, we need to send out image data encoded by DM368 via SPI use DMA resolution. In our design, we test the communication on one DM368, that SPI1 as the master, SPI2 as the slave. we connected SPI1 and SPI2 with SIMO and CLK, the rest pins were reserved. SPI1 was always the sender and SPI2 always the receiver.

    My test application is that, the sender send 256 bytes every second, and the receiver also receive 256 bytes one time. the receiver is work in kernel thread, and switch the buffer when a receive action is over, then setup the next receive. The code of receive and send were modified depend on  davinci_spi_master.c in linux-2.6.18 in SDK. And I got some problems as the follows.

1、When I send the data, I catched the signals of SIMO and CLK with oscillograph. some times, the second data was disappered, the first data was followed by the third data.

2、It was right at the beginning, but after  few minutes, the receiver is dead.  I think it was waiting for the completion of DMA. I printed message when the receiver was dead. I found the EMR and ER were set the bit which was related to the receiver channel of DMA. And the paRAM registers related to the receiver channel were the setup setting, they were not beginning to decrese. The ER was set that the SPI2 must notify the EDMA3TC, but why the DMA was not working? (The enable bit was setted, and when the receiver was dead, the sender was still alive).

3、The frist data received from DMA was  noneffective, how can I remove this data? (I tested that read the SPI2 BUF register before setting up the paRAM, but the noneffective data was still there)

 

 pleas give me some advice! THX!


Viewing all articles
Browse latest Browse all 123537

Trending Articles