Forum Discussion
Altera_Forum
Honored Contributor
14 years agouse 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. ...
Altera_Forum
Honored Contributor
14 years agoThe problem is solved. I add a delay after the SGDMA transfer and the descriptor chain works. I guess that a too frequent SGDMA transfer may cause this problem.
The modified code is as follows:
while(1)
{
// clear buf
memset(buf, 0, sizeof(buf));
// write single descriptor
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, &buf, 0, 0);
// enable SGDMA
alt_avalon_sgdma_do_async_transfer(sgdma_dev, &sgdma_desc);
usleep(10000); // must add this sleep
}