AnsweredAssumed Answered

DMA Memory To UART5

Question asked by clark.david.001 on Jun 25, 2012
Latest reply on Jun 2, 2016 by Clive One
Hi,

I'm having an issue setting up a DMA to transfer data from a 2 element uint8_t array to UART5.

The code works, but the UART only sends out the first byte and having tried lots of different things I don't understand what I need to do to make it push out the whole buffer.

Code is as follows :-

uint8_t myBuffer[2] = {0x55, 0x55};
 
DMA_DeInit(MEZZANINE_DMA_TX);
DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&UART5->DR;
DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t) myBuffer;
DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;
DMA_InitStructure.DMA_BufferSize = 2;
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Enable;
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;
DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
DMA_InitStructure.DMA_Priority = DMA_Priority_High;
DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
DMA_Init(MEZZANINE_DMA_TX, &DMA_InitStructure);
 
DMA_Cmd( MEZZANINE_DMA_TX, ENABLE );

Many thanks in advance for any responses,

Dave


Outcomes