Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12603 Discussions

DMA transaction between SDRAM and a UART

Altera_Forum
Honored Contributor II
997 Views

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
Altera_Forum
Honored Contributor II
314 Views

Marco, 

 

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