AnsweredAssumed Answered

DMA working in a strange way

Question asked by bharati.haraprasad on Jul 19, 2013
Latest reply on Jul 19, 2013 by Clive One
first of all the DMA code:
void DMA_Config(uint32_t addr)
{
//int addr=&ipbuffer;
NVIC_InitTypeDef NVIC_InitStructure;
DMA_InitTypeDef  DMA_InitStructure;


/* Enable DMA clock */
RCC_AHB1PeriphClockCmd(DMA_STREAM_CLOCK, ENABLE);


/* Reset DMA Stream registers (for debug purpose) */
DMA_DeInit(DMA_STREAM);


while (DMA_GetCmdStatus(DMA_STREAM) != DISABLE)
{
}
/* Configure DMA Stream */
DMA_InitStructure.DMA_Channel = DMA_CHANNEL;
DMA_InitStructure.DMA_PeripheralBaseAddr =addr;
DMA_InitStructure.DMA_Memory0BaseAddr =0x60010000;  //FSMC address
DMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToMemory;
DMA_InitStructure.DMA_BufferSize =480; //(uint32_t)BUFFER_SIZE;
DMA_InitStructure.DMA_PeripheralInc =DMA_PeripheralInc_Enable;
DMA_InitStructure.DMA_MemoryInc =DMA_MemoryInc_Disable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;//DMA_MemoryDataSize_Word;
DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
DMA_InitStructure.DMA_Priority = DMA_Priority_High;
DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable;
DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;
DMA_InitStructure.DMA_MemoryBurst =DMA_MemoryBurst_Single;
DMA_InitStructure.DMA_PeripheralBurst =DMA_PeripheralBurst_Single;
DMA_Init(DMA_STREAM, &DMA_InitStructure);


/* Enable DMA Stream Transfer Complete interrupt */
//DMA_ITConfig(DMA_STREAM, DMA_IT_TC, ENABLE);


/* DMA Stream enable */
DMA_Cmd(DMA_STREAM, ENABLE);


//interrupt enable
NVIC_InitStructure.NVIC_IRQChannel = DMA_STREAM_IRQ;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}

when i call 
  addr=&buffer[0]+4;
   DMA_Config(addr);
this works perfectly
 I have checked the addr its 536903104 when i call addr=&buffer[0];
and  536903108 when i call addr=&buffer[1];
but both of these calls dont work .it only works whwn i call  addr=&buffer[0]+4;then DMA_Config(addr);

can anyone explain whats happening ?

Outcomes