Altera_Forum
Honored Contributor
20 years agoEthernet and DMA
Hi everyone,
I'm working with a LwIP Stack (only using UDP) and make some timing measurements to find the nottlenecks of the stack. So I saw that the data transfer to the SMSC chip needs quiet some time. To reduce this time I added a DMA controller via SOPC builder. The problem is that when I start the DMA controller it will never end. The busy flag is set for ever. Does somebody use a DMA controller to get the data in the SMSC? Thx for your help revolt -------------------------------------------------------------------------------------------------------------------------------------------------------------------- SOPC Connections SDRAM -- DMA -- Tristate-Bridge -- SMSC int.SRAM / Code: int doDMAEthernet(volatile unsigned int* puiReadAddr,volatile unsigned int* puiWriteAddr,unsigned int uiLen) { while ((IORD_ALTERA_AVALON_DMA_STATUS(DMA_ETHERNET_BASE) & ALTERA_AVALON_DMA_STATUS_BUSY_MSK)); IOWR_ALTERA_AVALON_DMA_CONTROL(DMA_ETHERNET_BASE,0); IOWR_ALTERA_AVALON_DMA_STATUS(DMA_ETHERNET_BASE, 0); IOWR_ALTERA_AVALON_DMA_LENGTH(DMA_ETHERNET_BASE, uiLen); IOWR_ALTERA_AVALON_DMA_RADDRESS(DMA_ETHERNET_BASE, puiReadAddr); IOWR_ALTERA_AVALON_DMA_WADDRESS(DMA_ETHERNET_BASE, puiWriteAddr); // Start DMA // WORD (32 BIT) transfer // LEEN = Ends transaction when length reg reaches zero, write to constant address // WCON = write to fix address IOWR_ALTERA_AVALON_DMA_CONTROL(DMA_ETHERNET_BASE,ALTERA_AVALON_DMA_CONTROL_GO_MS K | ALTERA_AVALON_DMA_CONTROL_WORD_MSK| ALTERA_AVALON_DMA_CONTROL_WCON_MSK| ALTERA_AVALON_DMA_CONTROL_LEEN_MSK); while ((IORD_ALTERA_AVALON_DMA_STATUS(DMA_ETHERNET_BASE) & ALTERA_AVALON_DMA_STATUS_BUSY_MSK)); return 0; }