cancel
Showing results for 
Search instead for 
Did you mean: 

DMA between GPIO and SRAM STM32f303VCT6

saumil
Associate
Posted on November 21, 2014 at 06:27

Here I am trying to move the data at the SRAM location 0x20000010 into the ODR register of the GPIOE of STM32f303VCT6. 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?

int SRAM_ADDRESS __attribute__((section(''.ARM.__at_0x20000010'')));volatile Task_S_T *Task; Task = LCD_FIFO_Peek(); SRAM_ADDRESS = Task->Data; //initialize source and destination arrays uint32_t source = 0x20000010; // SRAM Starting address where the LCD Task data is loaded uint32_t destination = 0x48001014; DMA_InitTypeDef DMA_InitStructure; /* Enable DMA1 clock -------------------------------------------------------*/ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE); DMA_DeInit(DMA1_Channel1); DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)destination; DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)source; 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.

#stm32f303 #dma #gpio
1 REPLY 1
stm322399
Senior
Posted on November 21, 2014 at 09:49

DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Enable;

Incrementing the peripheral address is probably something you don't want.