AnsweredAssumed Answered

LPC541xx: SPI DMA with byte array

Question asked by pge on Aug 11, 2017
Latest reply on Sep 4, 2017 by pge

Dear all,

I am using a Flexcomm in SPI mode to send data to a peripheral. I don't care about received data.

I want to use DMA to send a large array of byte through this SPI. 

I used the fsl_spi_dma example from SDK and it works only with array of uint32_t so if I want to send this large array of byte I had to first allocate an array of uint32_t with the same number of elements, then copy all the byte to this new buffer and finally start the DMA. This of course not efficient at all and would like to send directly the byte array.


I have tried to change the fsl_spi_dma code to set DMA channel in byte mode but it doesn't work as expected. I also noticed that the SPI FIFO need 32bits word with only 16bits used as data others 16bits are used as config. Also the RXIGNORE is only configurable through this FIFO 16bits configuration. So again I can't directly use the DMA directly to transfer byte to SPI.


Is there any special mode or tricks to use DMA with SPI for 8bytes data without any additional copy ?


Thanks in advance for any help