Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21602 Discussions

help on burst transfer with DMA

Altera_Forum
Honored Contributor II
1,851 Views

Hi guys, 

 

I am using a DMA core to manage burst transfer between a SDRAM and a SRAM on a DE2-115 board.  

 

For the DMA core, I set DMA length register width to be 10 bits, and max burst size to be 128 words. Then I set the number of bytes to be transferred with function "alt_dma_txchan_send". 

 

But by playing with the chip, I found that the maximum bytes which can be successfully transferred was 568 bytes. Any value larger than that will not make the DMA transfer successful.  

 

I don't know why 568 is the magic number, since I think the max number of bytes should be 4*128 in this case.  

 

Any suggestion is appreciated!  

 

Leon
0 Kudos
9 Replies
Altera_Forum
Honored Contributor II
827 Views

I am almost sure that You've left one of the size or transfer times variable too small.

0 Kudos
Altera_Forum
Honored Contributor II
827 Views

Hi Socrates, 

 

Thanks for your reply. I realized that my setting of DMA length register width should be 9 instead of 10 in this case, since 128 words burst size = 2^9 bytes.  

 

If I set register width to be 9, then the phenomenon I described before will not show up because the program will report error if the data length I ask it to transfer is over the limit. 

I am just curious that when those two settings are not compatible, the program can send out data stream with length in between.... 

 

And could you tell more about the transfer time variable? Is it the characteristics of the SRAM in use here? There is no time setting for DMA... 

 

Thanks.
0 Kudos
Altera_Forum
Honored Contributor II
827 Views

My english is bad :) What I meant transfer times is number of transfers. E.g. Packet size = 10 bytes, number of transfers = 20, so 200 bytes total transferred. 

 

There's nothing about time itself in DMA,
0 Kudos
Altera_Forum
Honored Contributor II
827 Views

Hi leon...i am trying to use this dma for the same purpose...i tried to send an array which defined on the sdram to the sram throught the dma, but without any success...how can i define from which address on the sdram i start the data transfer and to what address i transfer them? 

Thank u very much
0 Kudos
Altera_Forum
Honored Contributor II
827 Views

Are You using SGDMA?

0 Kudos
Altera_Forum
Honored Contributor II
827 Views

no,the regular DMA.... whats the diffrence?

0 Kudos
Altera_Forum
Honored Contributor II
827 Views

 

--- Quote Start ---  

Hi leon...i am trying to use this dma for the same purpose...i tried to send an array which defined on the sdram to the sram throught the dma, but without any success...how can i define from which address on the sdram i start the data transfer and to what address i transfer them? 

Thank u very much 

--- Quote End ---  

 

 

Hard to say clearly... 

if you like, please send me your email and I will send you my code. It is around 27M after compression.
0 Kudos
Altera_Forum
Honored Contributor II
827 Views

great!!thanks!! 

musicol@orange.net.il
0 Kudos
Altera_Forum
Honored Contributor II
827 Views

I highly recommend sending your email address through a private message/private email to other users. Spammers have automated systems for finding email addresses in forums/webpages so it's not a good idea to post yours for all to see.

0 Kudos
Reply