Hi,
I am working on a project, in which I want to copy a data from SD card (on SSP0) to a USB flash drive, I want to reduce the time span required to copy data from SD card to USB drive,so I decided to use a DMA. No such provision to access the DMA, to copy data from SD card to USB directly , I must first need to copy few bytes in memory buffer, then transfer that bytes from memory buffer to USB drive repeatedly to copy 8GB. I also explore the sample DMA example in code bundle LPC23xx-24xx Sample Software. Can you suggest a simpler way to accomplish this DMA transfer. It will be more helpful if you could provide a other code example
Hi Mohammad,
For additional DMA usage/details, you could take a look to the following link:
https://www.embeddedrelated.com/showthread/lpc2000/29543-1.php
Additionally, please consider that the procedure would vary if you are performing DMA transfers from raw data vs. files. If you are transferring files from the SD card to a USB thumb drive, the files may be fragmented, so, the DMA should be integrated on the File System library.
Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks CarlosCasillas,
I have gone throw the link, and also refer another post on the embeddedexplorer
lpc2000 | DMA->SSP/SPI Mystery on LPC2468
void callPer2Mem(void)
{
DWORD i;
char FIFOSIZE = 8;
DMA_Init(0,P2M);
GPDMA_CH0_CFG |= 0X08001 | (0X01 << 1) | (0X06 <<11); // need your help here access the SSP0 Rx To //USBmemory
SSP0DMACR = 0X03; // ENB DMA RTX SSP0
src_addr = DMA_SRC;
dest_addr = DMA_DST;
i=0;
while(i<= SSP_BUFSIZE)
{
SPI_Write(src_addr);
SPI_Write(dest_addr);
src_addr += FIFOSIZE;
dest_addr += FIFOSIZE;
i+= FIFOSIZE;
}
for(i=0; i<SSP_BUFSIZE; i++)
{
if(src_addr != dest_addr)
{
// while(1) ;
}
return;
}
}
I am not getting a data from sd card into a USB RAM, when I call the above function.Please help, I refer the code bundle
warm regards
Mohammad Faizan