2

On Arduino Due, I set-up DMA transfers using direct control of memory mapped hardware registers.

There is a 16-bit BTSIZE field in CTRLA which indicates the number of (width sized) transfers. If I specify larger than 8191, the value of btcount is trimmed to 13 bits after the DMA channel is enabled. I set chunk size src/dest to 1.

The ATMEL data sheet for the sam3x (linked from the due page) does not mention this 'limitation' (section 22.7.16), or possibly I'm using it wrong.

What reference is canonical and correct for the DMAC (dma controller)?


As noted in the links in the comments, multi-buffer transfer can work around this, but since I don't know why it works or fails, it's hard to decide if that solution will work in all cases.

  • Please post the code that does this transfer. – Nick Gammon Jan 16 '16 at 3:23
  • This looks relevant: community.atmel.com/forum/… – Nick Gammon Jan 16 '16 at 3:27
  • Thanks for the link, I moved to multi buffer continuous transfer too, which works around the issue, but doesn't really answer the question:where can I get good/correct documentation for the Dmac. Note that there are other problems with the datasheet Dmac documentation relating to multi buffer transfer. – Alex Brown Jan 16 '16 at 3:30
  • I have made two or three bug reports direct to Atmel about their documentation. In each case they acknowledged it was wrong and said they would fix it. Possibly there is no good/correct documentation on this point. Contacting Atmel and submitting a ticket might help correct this situation. – Nick Gammon Jan 16 '16 at 3:32
  • Thanks for your help, hopefully this will help the next person. I'll add more working Dmac code in this and other questions when I get some time. – Alex Brown Jan 16 '16 at 3:33
2

I'll quote the answer given in this link to help make this question more useful for future people who search this problem.

The dmac.h file in asf library has a macro named DMA_MAX_LENGTH set to 0xFFF = 4095. We tried changing it to higher values but still Buffer Transfer size (BTSIZE) register was showing only values till 4095. This seemed to us to a hardware limitation of the DMAC in Atmel SAM3x8E (which we did'nt see mentioned in the datasheet). So this closed the option of single buffer transfer for us and we moved to multi-buffer transfer

It was a simple way out (even though I took some time to figure it out :P ) - Use multi-buffer transfer with contiguous source address! (see table 22.4 Row 3)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.