SPI through DMA - POP order issue

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

SPI through DMA - POP order issue

595 Views
daniel_weber
Contributor I

Hi all,

I'm currently implementing SPI through DMA on a K22.  I have everything working except for the reads.  I can see SOUT, SCK, CS, and SIN all working on my oscilloscope, but the DMA handler seems to be popping bytes out of the POP register in the wrong order.  Basically, I can send the slave [0x12, 0x34, 0x56] and see the same echo back on the bus, but what shows up in my read array is [0x00, 0x12, 0x34] while I can peak at the POP register and see 0x56 sitting in there, never getting popped out and into my read array.  I figure there must be some simple setting that's configured incorrectly, but I'm having some trouble wading through the config bits and finding which ones may have something to do with what I'm seeing.

In short, I expect the function to be "read > pop > read > pop > read > pop", but it seems to be going "pop > read > pop > read > pop > read" and just leaving that last read in the register.  Would anybody be able to shed some light on any config parameters relevant to this issue?

Thanks,

Daniel

Labels (1)
Tags (3)
0 Kudos
Reply
1 Reply

538 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Daniel,

hope you are doing well. My name is Sabina and I'll be happy to help out with this behavior. 

Could you please share how you are configuring the spi module in your K22? Are you basing yourself on an example? Also could you please let me know the environment you are working on: IDE version, SDK version, Evaluation board?

Best Regards,

Sabina

0 Kudos
Reply