LPC541xx: SPI DMA with byte array

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC541xx: SPI DMA with byte array

743 Views
pge
Contributor I

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

Labels (1)
Tags (2)
0 Kudos
2 Replies

500 Views
pge
Contributor I

Hello Carlos,

I am using SDK 2.2.1 with a custom board based on LPCXpresso 54114

Thanks

Patrick

0 Kudos

500 Views
Carlos_Mendoza
NXP Employee
NXP Employee


Hi pge,

Could you tell us which board and MCUXpresso SDK version are you using?

Thanks in advance!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos