AnsweredAssumed Answered

Receiving data from UART in Multiprocessor Mode on STM32F429 Discovery

Question asked by Michal.Pot on Sep 17, 2016
Hi all,

I have been browsing the forums and the documentation, but I can't seem to find any solution that would solve my particular problem. 

I'm using STM32F429 Dicovery Evaluation Kit and I would like to receive the data sent by another board (Nordic nrf51822) via UART. The other board sends the data occassionally, that is, there are several bytes (separately)  once per 2-3 minutes. 

I saw the UART Examples in the CubeF4 1.13 and basing on the IT example and the code generated by the CubeMX I set up the UART5 (PD2 for RX and PC12 for TX) running in the Multiprocessor Communication Mode. 

In the IT example, the reception process is carried out with the following code, if I understand correctly:

   if(HAL_UART_Receive_IT(&UartHandle, (uint8_t *)aRxBuffer, BUFFERSIZE) != HAL_OK)

  while (UartReady != SET)

   UartReady = RESET;

Furthermore, there is a function:

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *UartHandle)
  UartReady = SET;

This one is executing after the reception is completed, so I assume I can proccess the received buffer there, correct?

But what makes me confused is the first part. I have completely no clue where and when shall I call HAL_UART_Receive_IT and the while loop after it that waits for the end of the transfer. In other words, I don't know how to detect the incoming data in the moment that they appear and catch the whole incoming buffer. 

Any help would be greatly appreciated since I am completely stuck here.