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.

[参考译文] CC1350:射频内核在专有模式下停止接收。

Guru**** 2537100 points
Other Parts Discussed in Thread: CC1350

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1030113/cc1350-rf-core-stops-receiving-in-proprietary-mode

器件型号:CC1350

大家好、

我在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 &currentDataEntry->data:
          * - Length is the first byte with the current configuration
          * - Data starts from the second byte */
         packetLength      = *(uint8_t*)(&currentDataEntry->data);
         packetDataPointer = (uint8_t*)(&currentDataEntry->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 锁定?

谢谢

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    约书亚、您好!

    几个问题:

    1) 1)您在中继器、传感器或收集器设备上看到这种情况吗? (还是全部?)

    2) 2)发生这种情况时、Rx 命令的状态是什么?

    3) 3)可以使用逻辑分析仪监控 Tx 和 Rx 引脚。 您可以使用此选项检查 Rx 停止或未重新计划的时间点。 请参阅用户指南:

    https://dev.ti.com/tirex/content/simplelink_cc13x0_sdk_4_10_01_01/docs/proprietary-rf/proprietary-rf-users-guide/proprietary-rf-guide/debugging-index.html#debugging-rf-output

    谢谢、

    玛丽·H.

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Marie、

    我已经能够通过查看 RX 命令的状态代码来找出问题。  我收到 PROP_ERROR_RXBUF 状态错误。  我不确定 RFQueue 条目是如何未被释放的,因为每次 Rx_callback 运行  RFQueue_nextEntry()时,会运行命令以释放该条目。

    为了解决此问题、我只需检查 RX 命令状态、查看 是否发生了 PROP_ERROR_RXBUF 错误。  如果是这样、我在将 RX 命令发布到 RF 内核之前释放 RFQueue 条目。  如果两个队列条目都不处于 DATA_Entry_Pending 状态、我还会检查下一个条目是否空闲。  这似乎解决了我的问题、不再发生 RX 锁定。

    /* Send Rx command to RF core */
    if(RF_cmdPropRx.status == PROP_ERROR_RXBUF) // Check if Free RFQueue entry
    {
        uint8_t entryStatus = RFQueue_nextEntry();
        if(entryStatus != DATA_ENTRY_PENDING)           // Test if Queue entry is free
        {
            RFQueue_nextEntry();        // Free next entry
        }
    }
    
    rxCmdHndl = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, &Rx_callback, RF_EventRxEntryDone);

    谢谢、

    Josh

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    感谢您发布解决方案!

    谢谢、
    玛丽·H.