AnsweredAssumed Answered

Configuration of DMA for USART-RX buffer

Question asked by Greusard Alexandre on Aug 14, 2017
Latest reply on Aug 16, 2017 by Greusard Alexandre

Hey there!

 

I'm working on stm32f051 MCU for a little project and a I  have to receive and process data from its USART port 1.

My issu is that I don't have any interuption from the DMA, and if I check directly on the buffer selected for the memory transfert there is also nothing in it.

But I do receive informations when I work with the USART directly ( from the USART1_IRQHandler() )

And I make DMA working fine with ADC.

I'm completly lost and going mad about this for to much time now.

 

I'd be glad to have any answer, and please tell me if you need any informations mere!

 

Here is my code:

 

#define USART_RX             GPIO_Pin_10
#define USART_TX             GPIO_Pin_9
#define USART_source_RX         GPIO_PinSource10
#define USART_source_TX         GPIO_PinSource9
#define USART_PERIPH                    USART1
#define USART_BAUDRATE                  115200

#define MSG_SIZE_MAX 50

static char msg[MSG_SIZE_MAX];
#define DMA_RX_BUFFER_SIZE          4
static uint8_t DMA_RX_Buffer[DMA_RX_BUFFER_SIZE];

 

static uint32_t Send_Byte (uint8_t c)
{
    while (USART_GetFlagStatus(USART_PERIPH, USART_FLAG_TXE) == RESET);
    USART_SendData(USART_PERIPH, c);
  return 0;
}

 

void SendPacket(uint8_t *data, uint16_t length)
{
  uint16_t i;
  i = 0;
  while (i < length)
  {
    Send_Byte(data[i]);
    i++;
  }
}

 

 

LeGreuch

Outcomes