cc3200做slave,master通过spi传视频数据给cc3200,master的clk是16m,每发送1个512字节的报文后delay 1ms,在cc3200端接收时会产生丢包的情况,
如果每发送1个512字节的报文后delay 2ms,则cc3200都可以正确接收到所有报文。我看3200的datasheet是宣称spi支持到20m,为什么16m都会产生丢包?
我目前SPIFIFOLevelSet(ulBase,1,1);,fifio设置为1的,用的是eow中断,用eow中断时,是不是不受AEL/AFL设置值的影响?我们有什么办法提升spi收包的吞吐量呢?目前这样的吞吐量根本无法满足传输264视频数据的需求,也没有达到datasheet中提到的spi支持到20m的性能,我们应该如果调整呢?
Terry Han:
可以参考SPI DMA的例子,通过DMA提高使用效率
https://github.com/severin-kacianka/cc3200_dma_spi_example/
cc3200_dma_spi_example
Here are two examples that show how to use SPI with DMA and FIFO on the CC3200. I hope that they are a useful starting point for anyone, who wants to work on SPI and DMA in the future.
The examples are compiling fine on Linux with gcc 4.9.3 from http://launchpad.net/gcc-arm-embedded. All you need to change is the path for the SDK in the Makefile. The hardware setup is similar to the SPI example in the SDK: just connect two CC3200 via cable (Pins GND, P05, P06, P07 and P08). I have set the following jumpers: J6, J7, J8. J9. J10, J11, J12, J13.
simple_spi_transfer is an example of an SPI transfer without DMA and FIFO. The master sends a buffer to the slave, reads it back in the next transfers and verifies the checksums.
transfer_1024_byte implements a simple SPI/DMA transfer that will transfer 1024 (or whatever DMA_SIZE is set to) bytes from the master to the slave and back. It then calculates the buffer's CRC checksum and (on the master) compares the send checksum to the received checksum.
transfer_64k shows how to transfer a 64k buffer from the master to the slave and back again.
windows contains a Makefile send to me by Matt van de Werken that also works using the Launchpad tools in a Cygwin enviroment