DMA between GPIO and SRAM on STM32

Here I am trying to move the data at the SRAM location 0x20000010 into the ODR register of the GPIOE of STM32f303. But it is not happening for me(I an not see the data change in the ODR while debugging) . I dont understand why. Can any one help me out in this?

EDIT

int SRAM_ADDRESS __attribute__((section(".ARM.__at_0x20000010")));

//initialize source and destination arrays
uint32_t destination = 0x48001014;
DMA_InitTypeDef   DMA_InitStructure;

/* Enable DMA1 clock -------------------------------------------------------*/
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE);

DMA_DeInit(DMA1_Channel1);

DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;
DMA_InitStructure.DMA_BufferSize = 16;
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Enable;
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;
DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
DMA_InitStructure.DMA_Priority = DMA_Priority_High;
DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
DMA_Init(DMA1_Channel1, &DMA_InitStructure);

DMA_Cmd(DMA1_Channel1, ENABLE);
LCD_Port_Set_Output();    // Just ensure that the LCD port is in output direction on the appropriate pin masks.
GPIO_SetBits(LCD_BUS_GPIO_PORT, LCD_E_PIN);                   // Toggle Enable pin on.
GPIO_ResetBits(LCD_BUS_GPIO_PORT, LCD_E_PIN);                 // Toggle Enable pin off.

• What exactly are you trying to do? You've defined your data arrays as holding 32 bit words, which won't fit in an 8 bit IO port - and the IO port will only hold one 8-bit byte at a time. Nov 17 '14 at 7:25
• I am trying to replicate the normal function (please see edit section) using DMA.
– spp
Nov 17 '14 at 8:28
• @spp: How do you locate your data at address 0x20000000? I think you should first put your data int a array, just like "uint32_t source[SIZE]", and then set this to the source address, look if it work well. If all works as you expected, then try put the data in absolute address. Nov 18 '14 at 11:33
• Which IDE are you using? If is ARM MDK, then if you want to put data in a absolute address, you do need some tricks, have you see this link: keil.com/support/docs/2829.htm? Nov 18 '14 at 11:39
• @diverger: You are right and that's how I have put the data in the absolute address just like that only and I verified that using keil's feature to look in to the particular memory address.
– spp
Nov 18 '14 at 17:30

I am a bit stuck in that because do not have much knowledge on SRAM and how to access it. can anyone help me out here?

"SRAM" just like the memory on your PC, all your function stacks, and auto variables are located in it. In your code above, the two arrays:

uint32_t source[SIZE]; uint32_t destination[SIZE];

just are allocated in "SRAM", the code your posted, is using DMA to transfer data from array "source" to "destination", and when done, it generate a interrupt.

So, what your need is just locating your data in SRAM, then fire the DMA. If your data need be located at a given address such as "0x??????", the address need be in your SRAM's address. For STM32f303VCT6, the interanl SRAM starts from address 0x20000000, ends on 0x2000A000.

There may be different methods depend on which compiler you are using. For ARM MDK, you can go here: http://www.keil.com/support/docs/2829.htm

Update:

If you want to use DMA to transfer data/command from your memory to LCD. You may need:

1. Put your data/command in the fixed memory location. And you may need to set your LCD control pins, such as A0, enable, etc....
2. Set the "DMA_PeripheralBaseAddr" to "&GPIOX->ODR", "X" dependent on which GPIO port you are using.
3. Set "DMA_DIR" to "DMA_DIR_PeripheralDST";