AnsweredAssumed Answered

STM32F7 HAL UART TX DMA

Question asked by Lalit B on Oct 19, 2017

Hello,

 

I'm new to STM32F7 and not familiar with the design environment. I'm setting up 2 UART channels and in CubeMX I setup each UART channel to use normal DMA buffer instead of circular.  Here is a sample of what I'm trying to do.

 

HAL_UART_Init(&huart1);
HAL_UART_Init(&huart6);

 

uint8_t buffer1a[] = {0xFF, 0xD7};
uint8_t buffer1b[] = {0xFF, 0xCF, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x32, 0x00, 0x46, 0xF8, 0x00};

 

HAL_UART_Transmit_DMA(&huart1, buffer1a, sizeof(buffer1a));
HAL_UART_Transmit_DMA(&huart6, buffer1a, sizeof(buffer1a));
HAL_Delay(500);

 

while (1)
{
HAL_UART_Transmit_DMA(&huart1, buffer1b, sizeof(buffer1b));
HAL_UART_Transmit_DMA(&huart6, buffer1b, sizeof(buffer1b));

HAL_Delay(1000);

}

 

I need to change buffer1b in the while(1) loop and send out new data.

The first 2 DMA transfers work fine but the DMA transfers in the while(1) loop does not work at all.

What do I need to get this working.

 

Thanks.

Outcomes