Forum Discussion
Altera_Forum
Honored Contributor
13 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
}