Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by scout_3pm on Fri Sep 27 07:39:51 MST 2013

I'm new to the LPC43xx series and more especially LPC4357.
I have the LPC4357-K43WQA which is LPC4357-EVB + 4.3' TFT K430WQA-V4F.

I want to use SPIFI for storage of images, which then to be shown on the LCD.
LCD's framebuffer is in SDRAM. So I need to make DMA transfer from SPIFI to SDRAM.

I read the User Manual, but it doesn't became very clear how exactly i have to configure the GPDMA.
I was hoping looking at the Standard Peripheral Library from NXP to find the needed settings, but there nowhere is mentioned SPIFI as SRC or DST for the GPDMA. And this looks odd because in the User Manual I see that for Source Peripheral can be used SPIFI. So then I figure that maybe SPIFI as mapped onto the Memory Map it can be just configured as a Memory 2 Memory transfer, but i get strange result. Only part of the screen is filled and the pixels are corrupt.

I also in the STD Peripheral library didn't find where or how to configure if I want the address to be incremented after every chunk of data transfered.

Thank You for Your Time.

Here is my current code generating the described behavior above:

void DMA_SPIFItoFB_Init(const unsigned char image[])
GPDMA_Channel_CFG_Type myDMA0;

GPDMA_ChannelCmd(0, DISABLE);

/* Disable GPDMA interrupt */
/* preemption = 1, sub-priority = 1 */
NVIC_SetPriority(DMA_IRQn, ((0x01<<3)|0x01));


myDMA0.ChannelNum = 0; //highest priority DMA channel
myDMA0.TransferSize = (480*272*3)/4; //word size transfer 4 bytes = 32bit WORD
myDMA0.TransferWidth = GPDMA_WIDTH_WORD; //used only for M2M operation
myDMA0.SrcMemAddr = (uint32_t) image; //used only for M2M and M2P operation
myDMA0.DstMemAddr = (uint32_t) 0x28000000;
myDMA0.DMALLI = 0; //no linked list

/* Enable GPDMA interrupt */

// Enable GPDMA channel 0
GPDMA_ChannelCmd(0, ENABLE);