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++

How to use the Nios DMA?

Altera_Forum
Honored Contributor II
998 Views

Hi, in order to improve the performance, I hope use the Nios DMA (Not Nios II) module to increase the transfer speed. But now I don't know how to use it. I simply use its subroutine on my original circuit, but it does not work. So, can anybody send a simple exaple to me?? Thus, let me understand the design method of DMA module between the software and the hardware. And I will very appreciate your kindness. Thanks.

0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
295 Views

sorry, my email address is pipiwau@yahoo.com.tw

0 Kudos
Altera_Forum
Honored Contributor II
295 Views

Why not NIOS2 ?  

I where made DMA to speed up transfer between 2 memory's using nios2 and it not very dificault  

And i use HAL for that  

I can give examle to you 

if it's exactly that what you want.
0 Kudos
Altera_Forum
Honored Contributor II
295 Views

Here is soft for using DMA on NIOS2  

 

 

void memcpy_my(int *where,int * from,int howmurch) 

 

while ((IORD_ALTERA_AVALON_DMA_STATUS(WR_DMA_BASE) & ALTERA_AVALON_DMA_STATUS_BUSY_MSK)); 

 

IOWR_ALTERA_AVALON_DMA_CONTROL(WR_DMA_BASE,0); 

IOWR_ALTERA_AVALON_DMA_STATUS(WR_DMA_BASE, 0); 

IOWR_ALTERA_AVALON_DMA_LENGTH(WR_DMA_BASE, howmurch); 

IOWR_ALTERA_AVALON_DMA_RADDRESS(WR_DMA_BASE, from); 

IOWR_ALTERA_AVALON_DMA_WADDRESS(WR_DMA_BASE, where); 

IOWR_ALTERA_AVALON_DMA_CONTROL(WR_DMA_BASE,ALTERA_AVALON_DMA_CONTROL_GO_MSK | 

ALTERA_AVALON_DMA_CONTROL_BYTE_MSK| 

ALTERA_AVALON_DMA_CONTROL_WEEN_MSK| 

ALTERA_AVALON_DMA_CONTROL_LEEN_MSK); 

while ((IORD_ALTERA_AVALON_DMA_STATUS(WR_DMA_BASE) & ALTERA_AVALON_DMA_STATUS_BUSY_MSK));# ifdef DEBUG 

printf("\nDMA packet\nfrom 0x%x\nwhere - 0x%x\nhowmurch - %d",from,where,howmurch); 

short status=0;# endif 

 

}
0 Kudos
Altera_Forum
Honored Contributor II
295 Views

But what headers are required ? Does it work under uClinux (I have read this (http://www.altera.com/literature/hb/nios2/n2sw_nii52010.pdf), is it enough ?) ? Do I have to use nios-ide ? Can I use only the nios2-toolchain ? Sorry for the many question.

0 Kudos
Altera_Forum
Honored Contributor II
295 Views

Hi All, 

I'm trying to use NIOS2 DMA too, but actually I have to transfer data to/from an external device from/to my NIOS2 cpu. Please, 

what's your impression on this, does anyone have some suggestion to me in the architecture definition? I should have some kind of input/output 

device to connect to the dma avalon master, maybe a PIO? and how to manage FLOW control trough the PIO, for DMA and my external 

device?  

Thanks a Lot Massy
0 Kudos
Reply