freertos and uart
I am trying to capture UART message once a button is pressed. I have implemented the functions to do that and while debugging i see the steps required to do that.
However, when the UART communication happen, i get strange messages (check photo)
Note: i am not using a Queue nor a separate to do the UART comm. However, you can see a GUI_Task mentioned in the UART message (that is the main task and this is not used within the code)
My code is the following:
if(xx==0)
{
HAL_UART_Transmit(&huart2, pData, sizeof(pData), HAL_MAX_DELAY);
char newline[2] = "\r\n";
HAL_UART_Transmit(&huart2, (uint8_t *) newline, sizeof(newline), 1);
xx++;
}
HAL_Delay(1000);
char in[8];
HAL_UART_Receive(&huart2, (uint8_t *)in, 8, 1000);
HAL_UART_Transmit(&huart2, (uint8_t *)in, 8, 1);
HAL_UART_Transmit(&huart2, (uint8_t *) "mata", 28, 1);
HAL_UART_Receive_DMA(&huart2, pData1, sizeof(pData1));
HAL_Delay(2000);
HAL_UART_Transmit(&huart2, pData1, sizeof(pData1),1);
xx=0;
return valoare;