Altera_Forum
Honored Contributor
14 years agoDMA problem
why when i use my dma, the program stucks here: --- Quote Start --- while (!rx_done); printf ("Transfer successful!\n"); --- Quote End --- pls help! thanks!
You can't DMA from dram to flash. DMA is like a normal memory write: the only difference is that it's performed by DMA controller and not by CPU.
Since flash can't be written as RAM, the operation is invalid. Anyway the DMA transfer should work, although after execution you will not find in the flash memory the transferred data. I suggest in the debug phase you don't use the while(!rx_done) instruction, which involves dma interrupt. Instead, wait for a while (i.e. with a long loop) and then test if your data has been correctly transferred. You may even test the status bits for dma completion. As said above you must first change your buffers: dma from sdram to sdram, or from flash to sdram.