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 :)
