Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
683 Views

DMA transaction between SDRAM and a UART

I would like to begin a DMA transaction between SDRAM and a UART on my Nios Development kit. 

This is the code: 

 

while(1) 

IOWR_8DIRECT(DMA_BASE,1,SDRAM_BASE); // read address 

IOWR_8DIRECT(DMA_BASE,2,UART_0_BASE); // write address 

IOWR_8DIRECT(DMA_BASE,3,768); //length 

IOWR_8DIRECT(DMA_BASE,6,0x281); // config 

IOWR_8DIRECT(DMA_BASE,6,0x289); //GO! 

i=IORD_8DIRECT(DMA_BASE,0); //read status 

usleep(1000000); 

 

i equals 0 if I put a breakpoint on the usleep line (after the delay, it always equals 0) ; at least the BUSY or DONE bit should be high. 

I obtain nothing on the output pin (seen with an oscilloscope; I obtain data if I "fputc" them). 

 

Any ideas? 

Regards, 

Marco Lazzaroni
0 Kudos
1 Reply
Highlighted
Valued Contributor III

Re: DMA transaction between SDRAM and a UART

Marco, 

 

Try using IOWR_32DIRECT instead of IOWR_8DIRECT - the DMA registers are aligned to 4-byte boundaries.
0 Kudos