This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

STM32 UART DMA can receive first time correct then it receive nothing

0

I'm trying to use dma with uart in stm32f746 nucleo in receiving mode i can receive correct data in first use when i try to receive again receiving buffer doesn't change its initial values before receiving although i can get receive complete signal callback every time

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/ Main Loop */ while(1) { HAL_GPIO_TogglePin(LED_PORT,LED_GREEN); // Led Example
HAL_Delay(200);
pRxData[0]=5;
pRxData[1]=0;
// HAL_UART_Receive_IT(&UartHandle,pRxData,2);
if( HAL_UART_Receive_DMA(&UartHandle,pRxData,2)==HAL_OK); // UART-DMA-IT Example
{
while (UartReady != SET) // wait for msg len
{
HAL_GPIO_WritePin(LED_PORT,LED_GREEN,1);
HAL_Delay(20);
HAL_GPIO_WritePin(LED_PORT,LED_GREEN,0);
HAL_Delay(400);
}
UartReady = RESET; // reset transmition flag
LEN = pRxData[0]+pRxData[1]*256; // calc msg length
if ( LEN > 0 )
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

0