I have two threads that read from the serial port:
thread A:
Code: Select all
uartStartReceive(&UARTD3, BUFFER_SIZE_A, rx_buffer_A);thread B:
Code: Select all
uartStartReceive(&UARTD2, BUFFER_SIZE_B, rx_buffer_B);In both threads, after I run the uartStart() function, I start reading on both ports.
The ports are assigned the following callbacks:
UARTD3:
- callback txend1_cb: set A_txend1_cb() function.
- callback rxend_cb: set A_rxend_cb() function.
- callback rxerr_cb: set A_rxerr_cb() function.
- callback timeout_cb: set A_timeout_cb() function.
UARTD2:
- callback rxend_cb: set B_rxend_cb() function.
- callback rxerr_cb: set B_rxerr_cb() function.
- callback timeout_cb: set B_timeout_cb() function.
The thread A sends commands to a device and waits for a response. When I run thread B, I have observed that the response is lost.
I have checked that in the txend1_cb() callback the command has been sent but I never receive anything through the UARTD3 port. If I only execute thread A, I receive the response associated with the command that I sent.
Is this problem because I have different functions assigned to each callback?
Thank you