iNAND: File Copy speeds vary widely


I am using iNAND (SDIN5D2-4G-L) on my WinCE7 device. The iNAND is a folder in WinCE7 OS.
Recently, it was complained that the file copy speeds vary widely, when a file (e,g, 20MB) is copied inside the iNAND.
I can duplicate the problem as follow,

  1. Copy the file (20MB) to the folder located in iNAND in WinCE7 OS, the copy is completed normally.
  2. Copy the file inside iNAND several times. First copy and second copy are both completed normally.
  3. But a strange phenomeno occured when I copied the file inside iNAND for the 3rd times. The copy process stopped for about 500ms every 4MB copied.
  4. I continued to copy the file, the result mentioned in step2 and step3 can be duplicated. i.e. the 4th copy and 5th copy is good, the 6th copy will pause for about 500ms every 4MB copied.

Then I checked the debug messages output from EMMC driver, and found EMMC driver is waiting for DMA_COMPLETE interrupt in the 500ms.

When I copied the file inside iNAND, DDR mode and high speed are enabled, clock is 26MHz. Block size is 512 bytes, the block number for each DMA is 128 (64 is also tested). I also disabled DDR mode to do the test, result is same.

I have used different size of files to do the test (5MB, 10MB, 20MB, 50MB, 80MB, 120 MB). The similar result can be seen. Sometime, the file copy was completed smoothly. Sometime, the copy process stopped for about 500ms every 4MB copied.

I checked the EMMC driver for several weeks, still don’t know why it is “every 4MB (accurate)” and what was done in this 500ms (vary from 470ms to 550ms).

Did you see the same problem before?
Can you help to tell me what may happen in this 500ms and where is wrong in my EMMC driver?

Thanks a lot.