cancel
Showing results for 
Search instead for 
Did you mean: 

How to display the uart data on stm32f429i eval board?

PSR1
Associate III

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.

15 REPLIES 15

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

https://community.st.com/t5/stm32-mcus/implementing-uart-receive-and-transmit-functions-on-an-stm32/ta-p/694926 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

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.

So you have confirmed that both Tx & Rx work in a simple standalone project without TouchGFX or FreeRTOS?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Yes, uart communication is happed in basic standalone project,
Here using Uart1_Tx= PA9, Uart1_Rx=  PA10 with interrupt enabled.

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() ?

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

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

 

 

Again, Please see How to insert source code.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

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 */
}

 

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?

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.