Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

use descriptor chain in SGDMA

Hi all

My current goal is to use SGDMA (ST-to-MM) to transfer video data to a memory.

Later on, I'll replace the memory by PCIE IP.

My problem is how to use descriptor chain in SGDMA.

In Qsys, the descriptor read and write signals of SGDMA are connected to an on-chip memory (mem A).

The Avalon-ST sink is connected to a test pattern generator.

The m_write signal which is an Avalon-MM master is connected to another on-chip memory (mem B ).

Basically, my idea is to transfer data from test pattern generator to mem B.

In Nios II, I write a simple C program doing the following things:

1) open SGDMA device with the function "alt_avalon_sgdma_open"

2) reset SGDMA with the macro IOWR_ALTERA_AVALON_SGDMA_CONTROL

3) register callback function with the function "alt_avalon_sgdma_register_callback"

4) write descriptor with the function "alt_avalon_sgdma_construct_stream_to_mem_desc"


alt_avalon_sgdma_construct_stream_to_mem_desc(&sgdma_desc, &sgdma_desc, buf, 0, 0);

5) start sgdma transfer by calling the function "alt_avalon_sgdma_do_async_transfer"

This simple program works well.

I see a control packet in the avalon-st interface and this packet is copied to the mem B successfully.

However, if I try to add the second descriptor, the program get stuck.


alt_avalon_sgdma_construct_stream_to_mem_desc(&sgdma_desc, &sgdma_desc, buf, 0, 0);
alt_avalon_sgdma_construct_stream_to_mem_desc(&sgdma_desc, &sgdma_desc, buf2, 0, 0);

My program seems to be trapped when I call "alt_avalon_sgdma_construct_stream_to_mem_desc" twice.

Does anyone know how to use descriptor chain in SGDMA correctly?

Thanks.

19 Replies