This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to avoid SPP data loss when bypass the data of Debug UART (Baud Rate:115200)?

Other Parts Discussed in Thread: MSP430F5335, CC2564

I am developing in MSP430F5335 + CC2564 with Bluetopia IAR SPPLEDemo_Lite project.

My Application is like the following:

I send the data into the MSP430F5335 via the debug UART, and the MSP430F5335 send the data to the CC2564 via HCI UART send out the data to PC via SPP .

PC ---> Debug UART  --->  MSP430F5335    --->    BT HCI UART  --->  CC2564  --->  BT SPP  ---> PC

   

To improve throughput , I have reference the following page for improve the throughput of CC2564 and config the parameter.

http://processors.wiki.ti.com/index.php/CC256x_MSP430_TI's_Bluetooth_Stack_Basic_SPPDemo_APP_Improving_throughput_v14

I also reference the sample code for reading data from debug UART in SPPDemo project , it use the HAL_ConsoleRead function for reading data from debug UART. The code is like the following:

In SPPLEDemo.c and in the ProcessCharacters()


void ProcessCharacters(void)
{
  char Char;
  while(HAL_ConsoleRead(1, &Char))
  {
      char Buffer[1];
      Buffer[0]=Char;
      Display(("Buffer[0] = %x \r\n",Buffer[0]));
      int TempLength = SPP_Data_Write(BluetoothStackID, SerialPortID, (Word_t)1, (Byte_t *)Buffer);
  }
}

The baud rate of Debug UART is 115200.  And I compare the data in Debug UART and the data in BT HCI UART via UART Sniffer.

The data will loss in BT HCI UART.

I send a lot of data into Debug UART like the following:

0xAA 0xAA 0x04 0x80 0x02 0x00 0x6D 0x10 
0xAA 0xAA 0x04 0x80 0x02 0x00 0x6D 0x10
0xAA 0xAA 0x04 0x80 0x02 0x00 0x6D 0x10 

And the data capture in HCI UART may loss some byte like the following:

0xAA 0xAA 0x04 0x80 0x02 0x00 0x6D 0x10 
0xAA 0xAA 0x04 0x80 0x02 0x00 0x10
0xAA 0x04 0x80 0x02 0x00 0x6D 0x10 

It will miss some Byte. It seems the data of Debug UART is too fast and the SPP_DATA_WRITE is too slow.

How to avoid SPP data loss when bypass the data of Debug UART (Baud Rate:115200)? 

Can some one give me some suggestions ? Thanks in advance and sorry about my English.