2025-02-13 01:50 AM - last edited on 2025-02-13 02:54 AM by SofLit
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 02:01 AM
Please see How to insert source code.
@PSR1 wrote:code added in main.c but uart receive interrupt is not working..
Before getting into the extra complications of interrupts, have you proved basic connectivity with a simple polled read?
Do this first in a standalone project - no TouchGFX.
https://wiki.st.com/stm32mcu/wiki/Getting_started_with_UART
https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Step3_Introduction_to_the_UART
2025-02-13 02:18 AM - edited 2025-02-13 02:26 AM
Hello Andrew Neil,
Thanks for supporting, as you mentioned i have done but the i'm facing the issue as to integrate the touch gfx designer generated FREERTOS code,
HAL_UART_Transmit(&huart1, TxData, 256 , 1000);
i added above line in main.c , The TxData is showing on teraterm.
Thanks & Regards,
PSR.
2025-02-13 02:31 AM
So you have confirmed that both Tx & Rx work in a simple standalone project without TouchGFX or FreeRTOS?
2025-02-13 02:40 AM
Yes, uart communication is happed in basic standalone project,
Here using Uart1_Tx= PA9, Uart1_Rx= PA10 with interrupt enabled.
2025-02-13 03:00 AM
Thanks - good to get that clear.
@PSR1 wrote:to integrate the touch gfx designer generated FREERTOS code,
HAL_UART_Transmit(&huart1, TxData, 256 , 1000);
i added above line in main.c , The TxData is showing on teraterm.
So a simple blocking transmit works in FreeRTOS with TouchGFX.
What about a simple blocking receive - HAL_UART_Receive() ?
2025-02-13 04:02 AM
Hello Andrew Neil,
Thank you for your support. I have quickly tested this code.
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);
}
Uart1 is showing data, but uart7 is not showing any data.
could you please help me to display the uart data?
Thanks
PSR
2025-02-13 04:17 AM
Again, Please see How to insert source code.
2025-02-13 04:38 AM - last edited on 2025-02-13 04:42 AM by Andrew Neil
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 */
}
2025-02-13 04:42 AM
So now you're using a different UART - UART7 !
As before, have you confirmed that both Tx & Rx on UART7 work in a simple standalone project without TouchGFX or FreeRTOS?