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

yes,

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);

?

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

PSR1
Associate III

Hello, Andrew Neil.

Is there any update?

Thanks &Regards,

PSR.

So what debugging have you done on your FreeRTOS version?

Compare & contrast against the standalone version - see where they differ.


@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?

Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.