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.

CC2340R5: Delay in UART data receiving with Data stream

Part Number: CC2340R5


Tool/software:

While working with CC2340R5, i have encountered a problem with uart receiving.
The original problem is in my custom project and  in simple terms, My project is echoing data from UART to BLE and vice versa.

To ease the support, i have reproduced the problem in the example Data stream with minor addition of code.


Simplink SDk version used: 8.20.0.119, 8.40.2.01

i have done the following things to reproduce the issue:

I have added uart initialization in Data Stream example  with default params.

  UART2_Params p;
  UART2_Params_init(&p);
  myuarthandle=UART2_open(CONFIG_UART2_0, &p);

I am sending a byte stream from ble app nrfConnect to my cc2340r5 device and writing all data to UART using 

 UART2_write(myuarthandle, pValue, len,NULL);

i have also connected UART RX with UART TX to echo my data back.

i have added the following code to receive uart data and write back to BLE connection.

static void* uart_recv_task(void* vData)
{
       ICall_EntityID entity;
    ICall_SyncHandle msgSyncHdl;
    ICall_registerApp(&entity, &msgSyncHdl);
    uint8_t b[100]={0};
    int a=0;
   
      while (1) {
                    UART2_readTimeout(myuarthandle, b, 1, &a,1);
                    if(a>0)
                    {
                         DSP_sendData( (uint8 *)b, a );
                    }
                   
                    vTaskDelay(1);
                    }
}

Now the problem is that i am receiving echo data in batches from ble. The issue is dependant on data length. Longer the length more batches are there.
i am attaching a screenshot of received data.

Since i have not added any such delays, the behavior is weird.
Also there is a pattern in the problem batch delays are almost multiple of 40.

I have also tested with ble disabled and by measuring tick difference between last sent on uart and last received on uart.
The tick difference is multiple of 10 in this case.

I have also verified that the uart_recv_task is being executed in every 2 ms.

I would appreciate any help.
Thanks