- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a sopc system include a DMA controller called "avalon_bus", which set up a channel to avalon bus.
My purpose is to realize memory-to-memory data transfer and sram is attached to avalon bus. But once the funcation "alt_dma_txchan_open("/dev/avalon_dma")" runs, the program freezes. I am not sure where the problem occures,the program or the sopc system. the code show below is from <<Nios II Software Developer's Handbook>>. Please give me some help ,thanks a lot! int main (int argc, char* argv[], char* envp[]) { int rc; alt_dma_txchan txchan; alt_dma_rxchan rxchan; void* tx_data = (void*) 0x901000; /* pointer to data to send */ void* rx_buffer = (void*) 0x902000; /* pointer to rx buffer */ /* Create the transmit channel */ if ((txchan = alt_dma_txchan_open("/dev/avalon_dma")) == NULL) { printf ("Failed to open transmit channel\n"); exit (1); } /* Create the receive channel */ if ((rxchan = alt_dma_rxchan_open("/dev/avalon_dma")) == NULL) { printf ("Failed to open receive channel\n"); exit (1); } /* Post the transmit request */ if ((rc = alt_dma_txchan_send (txchan, tx_data, 128, NULL, NULL)) < 0) { printf ("Failed to post transmit request, reason = %i\n", rc); exit (1); } ... .................................Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello yks2003,
Did you notice the errata of Nios II 5.0? DMA HAL routine results in illegal bus condition (SPR 176819) The Nios II DMA HAL routine results in illegal bus condition if: - the bursting DMA is connected to slaves wider than 32-bits or - the "word" checkbox on the Advanced tab in the GUI is unchecked or - the DMA master is connected only to slaves of data width less than or equal to 16 bits Workaround: Use a "freestanding" Nios II application to avoid using the HAL, and don't call the DMA init routine for the DMA in question.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page