I am working on baremetal application on TWRK65 developing low level driver for dspi, my main goal is to extract maximum throughput out of SPI so i am using edma. Currently I am facing a problem which is causing greater loss in throughput. The design of SPI_PUSHR register is such that lower 16 bits hold data while upper 16 bits hold command flags. The problem is that I can not pass data alone to DMA source channel for TX transmission, i have to always iterate through byte by byte data and set required flags and copy in to another local buffer bearing data and flags variable. This whole data copying operation is hitting greatly in dspi throughput. Without this copy operation i get 13 Mbps c for 20 MHz clock which is very good, but for proper spi transaction i have to copy all the flags and data which limits my throughput to around 3 Mbps for same clock. Is there any alternative way to avoid copy operation and pass data directly to dma buffers ?
已解决! 转到解答。
I figured out myself. To In order to avoid the loop, i am now doing first memory to memory transfer for all the incoming data through dma with 4 bytes offset, Then using the actual dma transfer. So loop is eliminated by Memory to Memory transfer of data and i am now getting great throughput.
I figured out myself. To In order to avoid the loop, i am now doing first memory to memory transfer for all the incoming data through dma with 4 bytes offset, Then using the actual dma transfer. So loop is eliminated by Memory to Memory transfer of data and i am now getting great throughput.
Hi,
If byte by byte collect SPI transfer data using DMA way, which is not an effective way.
DMA will reduce the core workload with bulk data transfer.
It need to check the core work load, the core combine a SPI byte with 16-bit SPI command to 32-bit data format will be faster than DMA.
After the SPI data (32-bit format) done, using DMA to start SPI transfer.
In another word, I want customer try to use core to do transfer SPI data format (8-bit) conversion (to 32-bit).
Wish it helps.
Have a great day,
Mike
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------