2025-02-13 1:50 AM - last edited on 2025-02-13 2:54 AM by mƎALLEm
Hello ST,
I'm trying to display the uart data on stm32f429i(MB1046) eval board GUI, followed below link as
https://controllerstech.com/touchgfx-5-data-from-uart-to-ui/,
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
{
RxData[Size] = '\0';
if (osMessageQueueGetSpace(uartQueueHandle)>0)
{
strncpy (uartData_q->Data, (char *)RxData, Size+1);
uartData_q->size = Size+1;
osMessageQueuePut(uartQueueHandle, &uartData_q, 0, 0);
HAL_UART_Transmit(&huart1, uartData_q->Data,uartData_q->size , 1000);
}
HAL_UARTEx_ReceiveToIdle_IT(&huart1, RxData, 256);
}
void StartDefaultTask(void *argument)
{
/* USER CODE BEGIN 5 */
HAL_UARTEx_ReceiveToIdle_IT(&huart1, RxData, 256);
/* Infinite loop */
for(;;)
{
osDelay(1000);
}
/* USER CODE END 5 */
}
This code added in main.c but uart receive interrupt is not working.
could you please help me to develop.
Thanks& Regards,
PSR.
2025-02-13 5:00 AM
yes,
2025-02-13 5:06 AM
Right: and you've demonstrated that both UART1 and UART7 work together without FreeRTOS 7 TouchGFX?
So this code works in a standalone project:
HAL_UART_Transmit(&huart1, TxData, 256 , 1000);
HAL_UART_Receive (&huart7, RxData, strlen((char *)TxData), HAL_MAX_DELAY);
HAL_UART_Transmit(&huart7, RxData, strlen((char *)RxData), 100);
?
2025-02-13 5:20 AM
yes, this transmission working fine.
Could you please go through the attached https://controllerstech.com/touchgfx-5-data-from-uart-to-ui/ , based on this i was generated the code and added the code. after you will get idea about task. please go through.
Thanks,
PSR
2025-02-13 9:33 PM
Hello, Andrew Neil.
Is there any update?
Thanks &Regards,
PSR.
2025-02-14 1:29 AM
So what debugging have you done on your FreeRTOS version?
Compare & contrast against the standalone version - see where they differ.
2025-02-19 1:16 PM
@PSR1 wrote:I have quick test on attached code, please go through,
could you please me to develop uart data on stm32f429 i eval display?Thanks ,
PSR
void StartDefaultTask(void *argument)
{
/* USER CODE BEGIN 5 */
HAL_UART_Transmit(&huart1, TxData, 256 , 1000);
HAL_UART_Receive(&huart7, RxData, strlen((char *)TxData), HAL_MAX_DELAY);
HAL_UART_Transmit(&huart7, RxData, strlen((char *)RxData), 100);
/* Infinite loop */
for(;;)
{
osDelay(1000);
}
/* USER CODE END 5 */
}
Not sure why FreeRTOS would have anything to do with UART7 not working, given the code is before the for loop?
The only thing I can think of is if your RxData doesn't start with characters, then the strlen will return 0. Calling HAL_UART_Transmit would not send any data
So are you sure RxData has a string and doesn't start with a null?