I am trying to understand the DMA settings needed to transfer 1,920,000 bytes from one section of DDR to another. I am working with D4D/eGui and need to utilize DMA transfers for the double buffering system. I am using MQX 4.0 and CW 10.6. The system is setup to use DMA channel 0. During this testing, no other DMA channels are active.
Caching has been DISABLED for memory region 7. This is needed to get any reasonable results.
Below are the DMA settings just prior to starting the DMA transfer. In order to get all the bytes (1,920,000), I need to set NBYTES_MLNO to a value of 960,000. I would have thought that either 1920000 would be used or 480,000 (=1920000/4) because I do have ATTR set to transfer 4 bytes at one time (SSIZE=2).
Can anyone explain why this value is needed?
PRE-DMA Settings
DMA_ES: 0x00000000
DMA_ERR: 0x00000000
DMA_CR: 0x00000400
SADDR: 0x70000000
SOFF: 0x00000004
SLAST: 0x00000000
DADDR: 0x70400000
DOFF: 0x00000004
DLAST: 0x00000000
ATTR: 0x00000202
NBYTES: 0x000EA600 (DMA_TCD0_NBYTES_MLNO = 960000)
CITER: 0x00000001
BITER: 0x00000001
CSR: 0x00000002
Attached is my ISR code. I found that I had to set the CSR to 0 in order to prevent multiple ISR calls from happening. The other statements in the ISR did not prevent this.
Sorry MQX 4.0 is too old, can you test it on MQX 4.2
Unfortunately both are no longer supported and MQX 5 has cost
Regards Vicente