你好,我想用dm368通过spi发送压缩视频,我把SPI设为DMA模式,但是第一个字节总是零,最后一个直接丢失,请问是什么原因
Chris Meng:
Shi Yanlong,
看起来像下面描述的情况。
http://processors.wiki.ti.com/index.php/StarterWare_McSPI
NOTE It is advisable to use the dummy transfer concept while handling McSPI Transmit events. This is because if a transmit event occurs from the McSPI to the EDMA, the EDMA will start transferring the bytes to the transmit register/FIFO of McSPI and hence the EDMA param set for Tx event will get depleted. The data from the transmit register/FIFO is immediately sent to slave device. Once the McSPI register/FIFO is empty the McSPI will generate a transmit event to the EDMA and since the EDMA param set is 0 the EDMA will not be able to service this event and a missed event will be generated which will be handled by the EDMA error handler. Hence to avoid this missed event the concept of dummy transfer can be used. In this concept a dummy PaRAM-Set is linked to the PaRAM-Set of the previous transmit event. This is done by giving the address of a dummy PaRAM-Set as the link address of transmit PaRAM-Set.
user4722282:
回复 Chris Meng:
你好,我现在是修改平台文件,调用spi_davinci驱动,并设成dma模式,底层驱动不是官方已经写好代码了吗,还是说我需要修改一些底层驱动代码,谢谢