Forum Discussion
Altera_Forum
Honored Contributor
15 years ago --- Quote Start --- Sorry, I'm always a bit faster in writing than in thinking, had to remove my stupid remarks there... So, then it should work when you swap the initialization? Setting the RX to OFF, before setting TX to on? I'm still struggling with the details and impacts of the concept... (Currently, I have an alt_dma_rxchan_prepare() that won't return) :confused: --- Quote End --- Well it's not working here yet either, but that's one thing to keep in mind. You can't set the register twice, since the second time it will overwrite the first time. So for streaming reading it has to be this:
if((txchan = alt_dma_txchan_open(DMA_WRITE_NAME)) == NULL)
{
printf("Failed to open transmit channel\n");
exit (1);
}
if((rxchan = alt_dma_rxchan_open(DMA_WRITE_NAME)) == NULL)
{
printf("Failed to open receive channel\n");
exit (1);
}
else
{
alt_dma_rxchan_ioctl(rxchan, ALT_DMA_SET_MODE_32, NULL);
alt_dma_rxchan_ioctl(rxchan, ALT_DMA_TX_ONLY_OFF, NULL);
alt_dma_rxchan_ioctl(rxchan, ALT_DMA_RX_ONLY_ON, ????); //rx_buffer or tx_data
}
As for the return, do you have the length of the data in words? And the addresses as well (or even doublewords). So length should be 0x0,0x4,0x8 etc. And addresses the same (or in my case 0x0,0x8,0x10 etc. are valid).