Tool/software: TI-RTOS
Hi,
I am trying to implement a simple application where I can receive data on the CC2650 through UART and send it to my phone over BLE. The data in the UART is received at a baud rate of 460800 8N1.
I am receiving about 75 characters every 500ms through the UART.
A sample of how the data looks like :
*@CKT~ 01 FAULT*ACKT~ 02 DONE*BCKT~ 03 DONE*CCKT~ 04 DONE*:@ FTV4-500-60
*:@State, C*:AState, O*:BState, O*:CState, O*:@ FTV4-500-60
*@ 80.44 V -425.9 A*A 80.44 V -425.9 A*B 80.44 V -425.9 A*C 80.44 V -425.9 A*:@ FTV4-500-60
with a few null characters at random places.
When I send this same data through Realterm serial monitor, I get the entire string, but when I try to read from the actual UART port (data received from another board) I am losing lots of characters. I am also monitoring the actual values received (from the other board) on the UART using another serial terminal so there is no problem in receiving the data, only while reading it.
Here is how I have implemented the read:
void myIdleFunc() { for (;;) { UART_read(handle, &input, 100); UART_write(handle,&input, 100); } }
UART_read is in BLOCKING mode with no timeout.
Here myIdleFunc() is a function that runs in the idle task.
The output that I am getting is:
I have also tried UART_echo example as well as several other options using CALLBACK method, changing the buffer size,invoking UART_read in a clock function, UART_read with timeout,etc. All have worse results than this method.
My suspicion is that UART_read stops reading when it hits a NULL value like strlen(). Is this true? If so how can I read past the NULL, how can I change the UART driver to copy past the null value.
Another possible problem might be that '*CCKT~ 04 DONE*:@ FTV4-500-' is right around 32 characters which is the maximum size of the buffer in the UART driver implementation.
Is there any other approach I should try, been stuck on this problem for a really long time.
I'm pretty sure my installation settings are right I've used on several other programs and faced no problems.
Code Composer Studio
Version: 9.0.1.00004