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

DMA between Custom Component and SRAM

Altera_Forum
Honored Contributor II
1,250 Views

Hi folks, 

 

instead of describing what I try to do, I have uploaded my whole project which speaks for itself. Here I will just post the main project structure and the questions I have: 

 

The main purpose of this project is to learn how to use a DMA SOPC modul to transfer data from my ads62_avalon_interface module to the SRAM. The ADS62 is a 2 channel ADC for which I wrote a custom SOPC component. 

 

I would ask you to check the SOPC system if everything is connected correctly (especially the connection of the DMA to the SRAM (via the tri_state_bridge) and my ADC component. 

 

The next question is, why the NIOS II program (in the software folder) is not working. The main question is, what is the destination adress? Is it the adress of the SRAM or the adress of the tri_state_bridge? 

 

As information: If I don't use the DMA but only the NIOS to transfer data from the custom component to the SRAM, everything works fine. 

 

I hope you don't mind that I send the whole project, but I think that we have a solid discussion base this way. 

 

Thanks,  

Maik
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
470 Views

Hi  

 

1) The way you connected the dma in SOPC Builder is correct 

 

2) You are reading data from a pheripheral so i think you need to use these 

alt_dma_rxchan_ioctl() & alt_dma_txchan_ioctl() functions  

 

ALT_DMA_SET_MODE_8, 

ALT_DMA_SET_MODE_16 

 

for transferring as a byte or halfword to memory  

 

The destination address should be SRAM not Avalan tristate bridge 

 

I too want to know this ,So let me know the correction if you get the result  

 

 

regards 

Kalyansrinivas
0 Kudos
Altera_Forum
Honored Contributor II
470 Views

Hi Kalyansrinivas, 

 

thanks for your answer! 

 

Good to know, that the SOPC connections are correct. 

 

Have you had a look at the custom component VHDL code? I read that the DMA is only working if the components use flow control. I would be happy if somebody could confirm that my component provides a correct flow control interface. 

 

If you look in the folder "software" then you can see what code I used to test the system. It is mainly a DMA example from the NIOS II Software developer Handbook (or was it the Quartus II handbook, I can't remember right now . . .). 

 

Maybe somebody else can make annotations to this project if there are things that are heading into the wrong direction. 

 

@Kalyansrinivas: I will let you know if your hints helped me to get the system running. We have to wait until next week because I don't have the hardware available, right now.  

 

Thank you, 

Maik
0 Kudos
Reply