Strange behaviour with LPC2478 - SD/MMC DMA transfer and I2C

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 18, 2016 by lpcware
Content originally posted in LPCWare by Brian S on Tue Apr 26 07:31:33 MST 2016

I'm experiencing some unexpected/unexplained behavior on a project I'm working on using an LPC2478 processor. I've looked through Errata documentation and combed through the user manual but haven't had any luck figuring out exactly what is going on.

My project is using an LPC2478 running Keil's RTX OS. I have an SD card which I'm using a DMA transfer to read/write and I'm using I2C as a master to communication to another processor on the board. The I2C is not using DMA. (Of course many other things are happening in the software as well but I've seemed to narrow the problem down to this area).

[u]Here is what I'm seeing:[/u]
If I start a DMA transfer to read from the SD card and during this time another thread starts and communicates over I2C it seems like occasionally the DMA transfer will fail to complete (based on the fact that the DMACIntStatus, DMACIntTCStatus, DMACIntErrorStatus flags aren’t being seen).

For the purposes of debugging, if I add a lock to my code to prevent the I2C from communicating from the start of the DMA transfer until complete, everything seems to work smoothly. Take this lock out and I have random failures where the DMA doesn’t signal completion (by random I’m guessing some specific timing). 

The bus is shared between the SD/MMC and the I2C so I'm not sure if there could be some bus conflict occurring but I wouldn't think that should happen using DMA. Also note that I am NOT seeing DMA interrupt errors (by checking DMACIntErrorStatus).

I don't really know what to look at next.

Any ideas are greatly appreciated!!