大家好、
我在915 MHz 频段的专有模式下使用 CC1350。 我有一个网络、其中包含收集器和传感器、中间有中继器。 我遇到中继器问题。 中继器监听并缓冲接收到的数据包。 然后、在接收到数据包后的随机时间间隔内、数据包将重新传输。 一切似乎都按预期工作、但有时射频内核中的接收功能似乎会脱机。 中继器仍然可以发送其状态数据包、我看到它们在 收集器上进入、但没有其他重复通信出现、并且每当接收到数据包时复位的看门狗计时器将超时复位器件。 我的看门狗计时器设置为6分钟、因此在相当长的时间内、中继器不会捕获 RX 数据包、而是仍然发送状态数据包。
我已经尝试过与应用处理器不同的射频命令变体、但它们似乎不会影响错误。 每当射频流量增加时、该错误也会更频繁地发生。 系统不同步时间、因此可能存在数据包冲突。 如果有任何见解,将不胜感激。
此项目已进行了一段时间、因此我将使用 SimpleLink CC13x0 SDK 版本1.60.0.21。
以下是向射频内核发送命令的相关代码。
static void rfTaskFunction(UArg arg0, UArg arg1)
{
/* create an Event object. All events are binary */
rfTaskEvent = Event_create(NULL, NULL);
if (rfTaskEvent == NULL) {
System_abort("Event create failed");
}
RF_Params rfParams;
RF_Params_init(&rfParams);
if( RFQueue_defineQueue(&dataQueue,
rxDataEntryBuffer,
sizeof(rxDataEntryBuffer),
NUM_DATA_ENTRIES,
MAX_LENGTH_EC + NUM_APPENDED_BYTES))
{
/* Failed to allocate space for all data entries */
while(1);
}
/* Modify CMD_PROP_RX command for application needs */
RF_cmdPropRx.pQueue = &dataQueue; /* Set the Data Entity queue for received data */
RF_cmdPropRx.rxConf.bAutoFlushIgnored = 1; /* Discard ignored packets from Rx queue */
RF_cmdPropRx.rxConf.bAutoFlushCrcErr = 0; /* Discard packets with CRC error from Rx queue */
RF_cmdPropRx.maxPktLen = MAX_LENGTH_EC; /* Implement packet length filtering to avoid PROP_ERROR_RXBUF */
RF_cmdPropRx.pktConf.bRepeatOk = 0; /* End Rx after receiving a packet correctly */
RF_cmdPropRx.pktConf.bRepeatNok = 0; /* End Rx after receiving a packet with CRC error */
RF_cmdPropRx.pOutput = (uint8_t*)&rxStatistics; /* Set up RX command to output statistics data */
RF_cmdPropRx.pktConf.bUseCrc = 0; /* 0: Do not check CRC */
/* Setup RF Properties Transmit */
RF_cmdPropTx.pktLen = HW_PACKET_LENGTH * REP_NUM;
RF_cmdPropTx.pPkt = packetEC_Tx;
RF_cmdPropTx.startTrigger.triggerType = TRIG_REL_SUBMIT; /* Trigger packet Tx command relative to submit */
RF_cmdPropTx.startTrigger.pastTrig = 1;
RF_cmdPropTx.startTime = PAIR_REPLY_DELAY;
RF_cmdPropTx.pktConf.bUseCrc = 0; /* Do not append CRC */
/* Request access to the radio */
rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
/* Set the frequency */
RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
/* Start initial Rx command in RF core */
RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, &Rx_callback, RF_EventRxEntryDone);
/* Setup periodic callback for transmit delay timer */
Util_constructClock(&TransmitPeriodicClock, TransmitPeriodicHandler, TRANSMIT_PERIODIC_TIMEOUT, TRANSMIT_PERIODIC_TIMEOUT, false, 0);
Util_startClock(&TransmitPeriodicClock);
Util_constructClock(&rssiTimerClock, RSSI_TimoutHandler, RSSI_HDC_PERIOD, RSSI_HDC_PERIOD, false, 0); // Setup RSSI clock with High Duty Cycle Timing.
Util_startClock(&rssiTimerClock);
UInt repeaterEvents;
RF_CmdHandle rxCmdHndl;
bool txReady;
while(1)
{
repeaterEvents = Event_pend(rfTaskEvent, RF_AND_EVENTS, RF_OR_EVENTS, BIOS_WAIT_FOREVER);
if(repeaterEvents & RSSI_SEND_EVENT)
{
PIN_setOutputValue(pinHandle, HW_PIN_RLED, LED_ON);
/* Force abort gracefully */
RF_cancelCmd(rfHandle, rxCmdHndl, 0);
SendRSSI_Packet(&packetHw);
/* Send Rx command to RF core */
rxCmdHndl = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, &Rx_callback, RF_EventRxEntryDone);
PIN_setOutputValue(pinHandle, HW_PIN_RLED, LED_OFF);
}
if(repeaterEvents & RF_RX_EVENT)
{
/* Blink Green LED to indicate RX */
PIN_setOutputValue(pinHandle, HW_PIN_GLED, LED_ON);
#ifdef WATCHDOG_ON
Watchdog_clear(watchdogHandle);
#endif
RF_cancelCmd(rfHandle, rxCmdHndl, 0);
/* Process Packet Received from RF */
RF_Packet_Process();
/* Send Rx command to RF core */
rxCmdHndl = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, &Rx_callback, RF_EventRxEntryDone);
PIN_setOutputValue(pinHandle, HW_PIN_GLED, LED_OFF);
}
if(repeaterEvents & TX_TMR_TIMEOUT_EVENT)
{
txReady = RF_Tx_Ready();
if(txReady)
{
/* Blink Yellow LED to indicate RX */
PIN_setOutputValue(pinHandle, HW_PIN_YLED, LED_ON);
/* Force abort gracefully */
RF_cancelCmd(rfHandle, rxCmdHndl, 0);
/* Send packet */
RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0);
/* Send Rx command to RF core */
rxCmdHndl = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, &Rx_callback, RF_EventRxEntryDone);
PIN_setOutputValue(pinHandle, HW_PIN_YLED, LED_OFF);
}
}
}
}
这是我的 RX 回调函数。
void Rx_callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
{
if (e & RF_EventRxEntryDone)
{
rxRatVal = RF_getCurrentTime();
/* Get current unhandled data entry */
currentDataEntry = RFQueue_getDataEntry();
/* Handle the packet data, located at ¤tDataEntry->data:
* - Length is the first byte with the current configuration
* - Data starts from the second byte */
packetLength = *(uint8_t*)(¤tDataEntry->data);
packetDataPointer = (uint8_t*)(¤tDataEntry->data + 1);
/* Copy the payload to the packet variable */
memcpy(packetEC_Rx, packetDataPointer, packetLength);
/* Move to next dataEntry */
RFQueue_nextEntry();
Event_post(rfTaskEvent, RF_RX_EVENT);
}
}
每分钟触发一次 RSSI_SEND_EVENT 以发送有关网络运行状况的信息。
TX_TMR_TIMEOUT_EVENT 每10毫秒触发一次、以查看之前接收到的数据包是否准备好重新传输。
使用射频命令是否会导致 RX 锁定但仍允许 TX 操作继续的问题?
是否有任何已知问题会导致射频内核发生 RX 锁定?
谢谢