Part Number: CC2642R
Hello,
I am using a CC2642R microcontroller to exchange UART messages with another microcontroller. The UART configuration is shown below:
UART_Params_init(&Uparams);
Uparams.writeDataMode = UART_DATA_BINARY;
Uparams.readDataMode = UART_DATA_BINARY;
Uparams.readMode = UART_MODE_BLOCKING;
Uparams.readEcho = UART_ECHO_OFF;
Uparams.readTimeout = 2000000;
Uparams.baudRate = 9600;
Uhandle = UART_open(0, &Uparams);
UART_control(Uhandle, UARTCC26XX_CMD_RETURN_PARTIAL_ENABLE, NULL);
I make a UART_write () command and immediately after sending I expect a response from another microcontroller and call the UART_read () command. But instead of a response from another microcontroller in the UART_read () buffer, I observe my sending from the UART_write () buffer. I have to restart the UART-read () command several times to get the package.
UART_write(Uhandle, buf, 15);
while ( (buf1[2] != '>') || (buf1[3] != '>') || (buf1[4] != ' ') ||
(buf1[5] != 'v') || (buf1[6] != '1') || (buf1[7] != '.') ||
(buf1[8] != '6') || (buf1[9] != '.') || (buf1[10] != '5') )
{
UART_read(Uhandle, buf1, 11);
lpcnt++;
if(lpcnt>10) break;
}
Maybe there is a way to get by with one read request?
Best regards, Maxim