cancel
Showing results for 
Search instead for 
Did you mean: 

Bypassing UART data received on one port to another without disturbing the DMA based reading

Abhishek Kumar
Associate III

I have a UART configured in DMA read mode:

/* task 1 code*/
uint8_t  dmaRXBuffer[1];
HAL_UART_Receive_DMA(&UART_DOWN_USB_TO_SERIAL, dmaRXBuffer, 1);
 
/* UART DMA receive complete ISR code*/
void HAL_UART_RxCpltCallback(UART_HandleTypeDef* huart) {
if (huart->Instance == UART8)  {
   xQueueSendToBackFromISR(queueXY, huart->pRxBuffPtr, NULL);
  }
}

so whenever it received a byte, it sends the data to a queue which is consumed by a RTOS task for its own functionality.

Now, at the same time without disturbing this functionality which resides in a task, what I also want is, whatever data is coming on this receive UART port should (without any waste of CPU cycle) be transmitted to another UART port on the mcu, how can I achieve this?

0 REPLIES 0