Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

DMA burst data transfer

Hi

I am working on DMA of Nios II ,

In SOPC builder i have set burst size of DMA as 128 words so i should be able to transfer 128 words or (128*4=512) bytes

In Nios IDE i see i am able to trasfer 128 bytes,256 bytes,384(256+128)bytes but not able to transfer 512 bytes

whats wrong with my code

After opening the tx and rx channels of DMA the data transfer in Dma is as follows

if((rc=alt_dma_txchan_send(txchan,EXT_RAM_BASE,128,NULL,NULL))<0)

{

printf("Failed to post transmit request ,reason =%i\n",rc);

exit(1);

}

/*Post the receive requestr*/

if((rc=alt_dma_rxchan_prepare(rxchan,(void*)offset,128,dma_done,NULL))<0)

{

printf("Failed to post read request ,reason =%i\n",rc);

exit(1);

}

regards

M Kalyansrinivas

6 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Maybe the "transfer size" you shoud set in the SOPC builder IS not big enough.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You have run into a known issue with the DMA core. There is a bug that prevents it from sending more data than the maximum burst length is set to. To work around this issue you can increase the maximum burst length of the DMA core. What kind of slave ports are you accessing that requires a max burst count of 128 beats? It could be that you don't even need bursting enabled.

    I recommend reading this to determine if you really need to be using bursting or not: http://www.altera.com/literature/hb/nios2/edh_ed51007.pdf
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi

    Thankyou all for replies

    For the question

    What kind of slave ports are you accessing that requires a max burst count of 128 beats

    I have connected SDRAM and SRAM as slaves to DMA and tried to transfer 512 bytes at one short from SDRAM to SRAM . I have enabled bursting of 128 words in SOPC

    I was able to transfer 128 bytes,256 bytes,& 384 bytes but not 512 bytes at one short

    I will try out without bursting enabled & reply back with results

    Regards

    M Kalyansrinivas
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    SRAM will not benefit from bursting. What kind of SDRAM are you using? I can probably make some suggestions to save you some time.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Well you are in luck, that is SDR SDRAM and the controller for that memory type is non bursting. So you do not need bursting at all so I recommend disabling burst support in the DMA and then you can transfer any memory to memory transaction you like.