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.

RTOS/LAUNCHXL-CC2640R2: Long range Demo Project PER Test

Part Number: LAUNCHXL-CC2640R2
Other Parts Discussed in Thread: CC2640, CC2650

Tool/software: TI-RTOS

Hi,

I am trying to run PER test on long range demo project.

I followed the instruction on cc2640 and cc2650 simplelink bluetooth low energy software stack 2.2.1 developer's guide (page 130).

I call the  HCI_EXT_PacketErrorRateCmd function every second.  Actually, when 

SBC_RSSI_READ_EVT

occurs the HCI_EXT_PacketErrorRateCmd will be called.


The PER result seems irrelevant because the number of Packet and number of Packet with CRC error counters overflow just in 5 second.
On the other hand, The overflow will occurs after 8 minutes of data as specified in TI BLE5-Stack API Documentation, .

Why the overflow occurs too early?

Here is the code 

    case SBC_RSSI_READ_EVT:
      {
        readRssi_t *pRssi = (readRssi_t *)pMsg->pData;

        // If link is up and RSSI reads active
        if (pRssi->connHandle != GAP_CONNHANDLE_ALL &&
            linkDB_Up(pRssi->connHandle))
        {
          // Restart timer
          Util_restartClock(pRssi->pClock, pRssi->period);

          // Read RSSI
          VOID HCI_ReadRssiCmd(pRssi->connHandle);

          // I added
          HCI_EXT_PacketErrorRateCmd(readPER.connHandle, HCI_EXT_PER_READ);
        }
      }
      break;

static void SimpleBLECentral_processStackMsg(ICall_Hdr *pMsg)
{
  switch (pMsg->event)
  {
    case GAP_MSG_EVENT:
      SimpleBLECentral_processRoleEvent((gapCentralRoleEvent_t *)pMsg);
      break;

    case GATT_MSG_EVENT:
      SimpleBLECentral_processGATTMsg((gattMsgEvent_t *)pMsg);
      break;

    case HCI_GAP_EVENT_EVENT:
      {
        // Process HCI message
        switch(pMsg->status)
        {
          case HCI_COMMAND_COMPLETE_EVENT_CODE:
            SimpleBLECentral_processCmdCompleteEvt((hciEvt_CmdComplete_t *)pMsg);
            break;

          
          // Process HCI Vendor Specific Command Complete Event
          case HCI_VE_EVENT_CODE:
              hciEvt_VSCmdComplete_t * command_complete = (hciEvt_VSCmdComplete_t *)pMsg;

              switch(command_complete->cmdOpcode)
              {
              case HCI_EXT_PER:
                  uint8_t status = command_complete->pEventParam[2];
                  if(status == SUCCESS){
                      uint8_t  cmdVal = command_complete->pEventParam[3];
                      if(cmdVal == 1){

                          uint16_t numPkts = BUILD_UINT16( command_complete->pEventParam[5],command_complete->pEventParam[4]);
                          uint16_t numCrcErr = BUILD_UINT16( command_complete->pEventParam[7],command_complete->pEventParam[6]);
                          uint16_t numEvents = BUILD_UINT16( command_complete->pEventParam[9],command_complete->pEventParam[8]);
                          uint16_t numMissedEvents = BUILD_UINT16( command_complete->pEventParam[11], command_complete->pEventParam[10]);

                          Display_print2(dispHandle, SBC_ROW_PER_PACKET, 0, "numPackets: %d numCrcErr: %d", numPkts, numCrcErr );
                          Display_print2(dispHandle, SBC_ROW_PER_EVENT, 0, "numEvent: %d   numMissedEvent: %d", numEvents, numMissedEvents );

                          //SimpleBLECentral_processPEREvt(command_complete);
                      }

                  }

                  break;
              }
            break;

Why overflow on the packet and packet CRC error counters  occurs too early ?

Thanks you for your attention

Have a nice day :)

  • Hello Erdem,

    The HCI_EXT_PacketErrorRateCmd is not fully implemented for the BT5 Long Range demonstration in CC2640R2 SDKs 1.35 and 1.40. This will be supported in a future SDK when the Long Range and Advertisement Extension feature is implemented.

    Note that if you are sending multiple packets per CE, the counters will increase faster than the 8 minutes listed in the document.

    Best wishes
  • Thanks for your reply JXS,

    As much as i know, the long range peripheral project sends temperature data every second and i did not do any changes on the long range peripheral project. Thus, i assume that, the peripheral project sends packet every 1 second and that makes impossible to causes an overflow on number of packet and number of packet with CRC error counters nearly in 5 second.

    Are there any chance to make CRC validation to coming signal from peripheral to the central. I do not want to use the HCI_EXT_PacketErrorRateCmd(). Instead of that, i would like to create my own function that keeps and calculate the PER value.

    If you have PER test application designed for long range project, it would be great to share with me :)

    Also, is it possible to make a connection by using LE Coded PHY directly? Because, in the demo project we should make a connection by using LE Uncoded 1M PHY after the connection the PHY will be moved to the LE Coded PHY.  

    Best regards

  • Hello Erdem ,

    There is no provision in the Bluetooth specification for the Controller to inform the Host of the CRC status - that is why we implemented the extension command. Also, CRC is computed locally, thus the CRC result is not "shared" with the peer device. The only way to detect this is with the SN/NESN ack bits.

    Best wishes