Problem receiving the data through UART using DMA
Hi, I am using STM32F407 board to communicate with a serial device. I have been using HAL_UART_Transmit() to send the data and using HAL_UART_Receive_DMA() to receive the data. Part of the code is shown below. After every receive command I am supposed to receive the transmitted data back and additional 8 bit reply. But I am not receiving anything. Is there something wrong with the way I am using the commands. Also when I use plain receive HAL_UART_Receive() instead of DMA, program is stuck in HAL_UART_Receive() function. Please let me know if you see any fundamental problems with the code.
uint8_t wakeup_seq[2] = {0xaa,0xaa};
uint8_t WDOG_CNT[6] = {0x1e, 0x80, 0x3d, 0x00, 0x7f,0x92};
HAL_UART_Transmit(&huart2,wakeup_seq,sizeof(wakeup_seq),HAL_MAX_DELAY);
HAL_Delay(1);
HAL_UART_Receive_DMA(&huart2,t_rxdata,sizeof(wakeup_seq)+1);
for(uint8_t i=0;i<sizeof(wakeup_seq);i++)
printf("%x \n",t_rxdata[i]);
HAL_UART_Transmit(&huart2,WDOG_CNT,sizeof(WDOG_CNT),HAL_MAX_DELAY);
HAL_Delay(1);
HAL_UART_Receive_DMA(&huart2,t_rxdata,sizeof(WDOG_CNT)+1);
for(uint8_t i=0;i<sizeof(WDOG_CNT)+1;i++)
printf("%x \n",t_rxdata[i]);
