EmbeddedRelated.com
Forums
Memfault Beyond the Launch

DMA read from MCI fifo

Started by Kuba Dorzak February 8, 2011
Try might want to optimize copying routine:
http://www.eetimes.com/design/embedded/4024961/Optimizing-Memcpy-improves-speed
.
If the USB RAM is too small, perhaps you could consider external memory.
GPDMA can access external memory which is not limited to 16kB. This way you
do not have to refill USB RAM.
Kuba

An Engineer's Guide to the LPC2100 Series

Thanks again. After optimizing the copy function I can decrease my ring buffer size (GPDMA linked list) down to 2*512 bytes. But to reach better speed, I increased it to 4*512 bytes.

Even though it is working I am keen to get a better understanding of the GPDMA setting and its affects on the MCI.

What makes me curious is the following behaviour:
Target: LPC2388
CPU CLK = 60MHz

1. Situation: MCICLK = 30MHz

Working GPDMA Setting (GPDMA_CH0_CTRL):
- TRANSFER_SIZE = 128 Bytes,
- SRC_BURST_SIZE = 16,
- DEST_BURST_SIZE = 16,
- SRC_TRANS_WIDTH = 32bit,
- DEST_TRANS_WIDTH= 32bit,
- SRC_INCREMENT = ENABLE,
- DEST_INCREMENT = DISABLE,
- PROTECTION = DISABLE,
- INT_ENABLE = ENABLE;

2. Situatuation: MCICLK = 15MHz

Working GPDMA Setting (GPDMA_CH0_CTRL):
Same setting as 1. Situation except: SRC_BURST_SIZE = 1,

To be honest, I still do not know why only both of the configurations are working for the 15/30MHz MCICKL.

Can anyone give me a hint, where I can get some detailed information. LPC23xx user manual does not help me to understand the issue.

Regards,
Heinz
Unfortunately the optimization of memcpy does not help. External memory is no alternative for me. Since I have found a GPDMA configuration working for 15MHz now, I am sticking to 15MHz MCICLK rate. This allows me to avoid such big USB RAM buffer size - a 4*512 Byte big ring buffer in USB RAM is enough to transfer up to 64*512 bytes per MCI. Speed is OK. Some cards do reach around 5MB/s.

Even though it is working I am keen to get a better understanding of the GPDMA setting and its affects on the MCI.

What makes me curious is the following behaviour:
Target: LPC2388
CPU CLK = 60MHz

1. Situation: MCICLK = 30MHz

Working GPDMA Setting (GPDMA_CH0_CTRL):
- TRANSFER_SIZE = 128 Bytes,
- SRC_BURST_SIZE = 16,
- DEST_BURST_SIZE = 16,
- SRC_TRANS_WIDTH = 32bit,
- DEST_TRANS_WIDTH= 32bit,
- SRC_INCREMENT = ENABLE,
- DEST_INCREMENT = DISABLE,
- PROTECTION = DISABLE,
- INT_ENABLE = ENABLE;

2. Situatuation: MCICLK = 15MHz

Working GPDMA Setting (GPDMA_CH0_CTRL):
Same setting as 1. Situation except: SRC_BURST_SIZE = 1,

To be honest, I still do not know why those are the only settings working for the two clock speeds. What is the impact of the MCI CLK on the Burst Size?

Can anyone give me a hint, where I can get some detailed information. LPC23xx user manual does not help me to understand the issue.

Regards,
Heinz
2011/8/3 ilovenxp

> **
> Unfortunately the optimization of memcpy does not help. External memory is
> no alternative for me. Since I have found a GPDMA configuration working for
> 15MHz now, I am sticking to 15MHz MCICLK rate. This allows me to avoid such
> big USB RAM buffer size - a 4*512 Byte big ring buffer in USB RAM is enough
> to transfer up to 64*512 bytes per MCI. Speed is OK. Some cards do reach
> around 5MB/s.
>
> Even though it is working I am keen to get a better understanding of the
> GPDMA setting and its affects on the MCI.
>
> What makes me curious is the following behaviour:
> Target: LPC2388
> CPU CLK = 60MHz
>
> 1. Situation: MCICLK = 30MHz
>
> Working GPDMA Setting (GPDMA_CH0_CTRL):
>
> - TRANSFER_SIZE = 128 Bytes,
> - SRC_BURST_SIZE = 16,
> - DEST_BURST_SIZE = 16,
> - SRC_TRANS_WIDTH = 32bit,
> - DEST_TRANS_WIDTH= 32bit,
> - SRC_INCREMENT = ENABLE,
> - DEST_INCREMENT = DISABLE,
> - PROTECTION = DISABLE,
> - INT_ENABLE = ENABLE;
>
> 2. Situatuation: MCICLK = 15MHz
>
> Working GPDMA Setting (GPDMA_CH0_CTRL):
> Same setting as 1. Situation except: SRC_BURST_SIZE = 1,
>
> To be honest, I still do not know why those are the only settings working
> for the two clock speeds. What is the impact of the MCI CLK on the Burst
> Size?
>

It's difficult to quess what settings make your system does not work, but
please note that MCI settings must fit the DMA settings. For example; the
MCI fifo is 32 bit wide and if you change this in your DMA config
- SRC_TRANS_WIDTH = 32bit,
- DEST_TRANS_WIDTH= 32bit,
it may work wrong.

Memfault Beyond the Launch