Hi,
I have other problem.
I use the DMA to transfer data corresponding to a picture to display on a LCD screen.
My picture has 800 x 480 pixels. Each pixel is codded on 2 bytes (65k Colors)
Then my picture take in a buffer 780000 Bytes.
My driver function must be capable to copy all the picture or only a part.
Then my pointer source pGet point on the first pixel to copy. Same for pPut which is the destination buffer.
Width is the number of pixel on a line to copy and Height is the number of (partial) line to copy.
I have the following code:
lcd_dma_tcd.SRC_ADDR = (uint32_t)pGet;
lcd_dma_tcd.SRC_WIDTH = 2;
lcd_dma_tcd.SRC_OFFSET = 2;
lcd_dma_tcd.SRC_MODULO = 0;
lcd_dma_tcd.DST_ADDR = (uint32_t)pPut;
lcd_dma_tcd.DST_WIDTH = 2;
lcd_dma_tcd.DST_OFFSET = 2;
lcd_dma_tcd.DST_MODULO = 0;
lcd_dma_tcd.LOOP_BYTES = Width * 2;
lcd_dma_tcd.LOOP_COUNT = Height;
lcd_dma_tcd.LOOP_SRC_OFFSET = (mHRes - Width) *2;
lcd_dma_tcd.LOOP_DST_OFFSET = (mHRes - Width) *2;
This code work when the size of picture to refresh is small.
But if my picture take a big part or all the picture (800x480) I have many problem:
lcd_dma_tcd.LOOP_BYTES = Width * 2; = 800*2 = 1600. But It seems the MQX (and/or DMA hardware) limit to 1024 bytes...:smileyconfused:
To try, When width = 800 and height = 480, I have the following code:
lcd_dma_tcd.SRC_ADDR = (uint32_t)pGet;
lcd_dma_tcd.SRC_WIDTH = 2;
lcd_dma_tcd.SRC_OFFSET = 2;
lcd_dma_tcd.SRC_MODULO = 0;
lcd_dma_tcd.DST_ADDR = (uint32_t)pPut;
lcd_dma_tcd.DST_WIDTH = 2;
lcd_dma_tcd.DST_OFFSET = 2;
lcd_dma_tcd.DST_MODULO = 0;
lcd_dma_tcd.LOOP_BYTES = 800;
lcd_dma_tcd.LOOP_COUNT = 960;
lcd_dma_tcd.LOOP_SRC_OFFSET = 0;
lcd_dma_tcd.LOOP_DST_OFFSET = 0;
But the software bug, transfert is not complete, only some pixel are copied.
Then, do you have an Idea to can make a copy on a complete buffer / and on a partial buffer which represent only a specified rectangular zone on the picture?
Another point: the speed transfer.
I don't find where the DMA clock is configured. My CPU Clock is 150MHz. But when I Copy an entire buffer (780KByte) this seems take between 150 to 200ms. If clock is 150MHz, this couls take 0.78/150 = 5ms.. ??