- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
have set up a simple hardware system where the nios writes data to a on-chip fifo, and a dma transfer it back to sdram. datawidth is 32 all the way. i also use rxchan_ioctl to set dma to 32 bit
first i do 32 writes, seeminly okay - but when i tell the dma to get it i must set the length parameter to 128 to empty the fifo. why dont i fetch number of words equal to length? also the first five words are not fetched correctly, why is that?Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The length register uses a byte format. So to move 32 words of width 32-bits that's 128 bytes you are moving.
If you are seeing data corruption make sure you are bypassing the cache or flushing it before kicking off the DMA.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
will do, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i now do a alt_dcache_flush_all before i "rxchan_prepare", but the first five words are still not transfered. prepare simply dont put anything there.
a new issue also came up. fifo_init now returns -1 wich means event clear error. what could cause this? an address issue?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Off the top of my head I'm not sure (I typically access the DMA registers directly.... and I haven't used that DMA in years). I would take a look at this document since the HAL portions of the DMA are documented in there: http://www.altera.com/literature/hb/nios2/n2sw_nii5v2.pdf Also I would use the macros in the DMA driver to read back the status register, you may see a bit in there that might explain what happened.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page