Forum Discussion
Altera_Forum
Honored Contributor
15 years agoHi andreg,
I see wrong things in your code. Check if they are only copy and paste errors or actual code errors: - in alt_dma_rxchan_prepare(), the 4th parameter should be dma_done, namely the pointer to function to be called upon dma completion - you wait dma completion testing a rx_done variable, but you actually set the other variable dma_complete when dma completes - are you sure the tx_data and rx_buffer addresses you provide match those of memories connected to tx/rx dma: you should use system.h defines instead of numeric values. I have a design similar to your one and it works perfectly. I tried to use your same code (with the above corrections) and the dma performs correctly. The only differences being: - dma width is 16bits - tx dma is from external sram connected to sopc tristate bus - rx dma is to the main sdram and not a separate onchip memory (I don't think you need that descriptor memory; you are not using a sgdma module) Final note: pay attention to define rx_done as volatile, otherwise compiler may assume the while loop never ends. Regards Cris