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.

LAUNCHXL-CC1310: RF接收两包就不能再接收

Part Number: LAUNCHXL-CC1310
Other Parts Discussed in Thread: CC1310


硬件模块:两个CC1310 Launcgpad 板子,ti提供的;
使用SmartRF studio软件发送数据包,射频接收模块范例是 RFPacketRx,
Smart studio自动连续发射数据(100包),接收模块只能接收两包,然后就不接接收,请问这是怎么回事?
如果使用Smart studio一包数据一包数据的发送则不会有这种问题。

接收两包后status显示PROP_ERROR_RXBUF

  • void *mainThread(void *arg0)
    {
    RF_Params rfParams;
    RF_Params_init(&rfParams);

    /* Open LED pins */
    ledPinHandle = PIN_open(&ledPinState, pinTable);
    if (ledPinHandle == NULL)
    {
    while(1);
    }

    if( RFQueue_defineQueue(&dataQueue,
    rxDataEntryBuffer,
    sizeof(rxDataEntryBuffer),
    NUM_DATA_ENTRIES,
    MAX_LENGTH + NUM_APPENDED_BYTES))
    {
    /* Failed to allocate space for all data entries */
    while(1);
    }

    /* Modify CMD_PROP_RX command for application needs */
    /* Set the Data Entity queue for received data */
    RF_cmdPropRx.pQueue = &dataQueue;
    /* Discard ignored packets from Rx queue */
    RF_cmdPropRx.rxConf.bAutoFlushIgnored = 1;
    /* Discard packets with CRC error from Rx queue */
    RF_cmdPropRx.rxConf.bAutoFlushCrcErr = 1;
    /* Implement packet length filtering to avoid PROP_ERROR_RXBUF */
    RF_cmdPropRx.maxPktLen = MAX_LENGTH;
    RF_cmdPropRx.pktConf.bRepeatOk = 1;
    RF_cmdPropRx.pktConf.bRepeatNok = 1;

    /* Request access to the radio */
    #if defined(DeviceFamily_CC26X0R2)
    rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioSetup, &rfParams);
    #else
    rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
    #endif// DeviceFamily_CC26X0R2

    /* Set the frequency */
    RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
    RF_cmdPropRx.endTime=8000000;
    /* Enter RX mode and stay forever in RX */
    RF_EventMask terminationReason = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRx,
    RF_PriorityNormal, &callback,
    RF_EventRxEntryDone);

    switch(terminationReason)
    {
    case RF_EventLastCmdDone:
    // A stand-alone radio operation command or the last radio
    // operation command in a chain finished.
    break;
    case RF_EventCmdCancelled:
    // Command cancelled before it was started; it can be caused
    // by RF_cancelCmd() or RF_flushCmd().
    break;
    case RF_EventCmdAborted:
    // Abrupt command termination caused by RF_cancelCmd() or
    // RF_flushCmd().
    break;
    case RF_EventCmdStopped:
    // Graceful command termination caused by RF_cancelCmd() or
    // RF_flushCmd().
    break;
    default:
    // Uncaught error event
    while(1);
    }

    uint32_t cmdStatus = ((volatile RF_Op*)&RF_cmdPropRx)->status;
    switch(cmdStatus)
    {
    case PROP_DONE_OK:
    // Packet received with CRC OK
    break;
    case PROP_DONE_RXERR:
    // Packet received with CRC error
    break;
    case PROP_DONE_RXTIMEOUT:
    // Observed end trigger while in sync search
    break;
    case PROP_DONE_BREAK:
    // Observed end trigger while receiving packet when the command is
    // configured with endType set to 1
    break;
    case PROP_DONE_ENDED:
    // Received packet after having observed the end trigger; if the
    // command is configured with endType set to 0, the end trigger
    // will not terminate an ongoing reception
    break;
    case PROP_DONE_STOPPED:
    // received CMD_STOP after command started and, if sync found,
    // packet is received
    break;
    case PROP_DONE_ABORT:
    // Received CMD_ABORT after command started
    break;
    case PROP_ERROR_RXBUF:
    // No RX buffer large enough for the received data available at the start of a packet
    break;
    case PROP_ERROR_RXFULL:
    // Out of RX buffer space during reception in a partial read
    break;
    case PROP_ERROR_PAR:
    // Observed illegal parameter
    break;
    case PROP_ERROR_NO_SETUP:
    // Command sent without setting up the radio in a supported
    // mode using CMD_PROP_RADIO_SETUP or CMD_RADIO_SETUP
    break;
    case PROP_ERROR_NO_FS:
    // Command sent without the synthesizer being programmed
    break;
    case PROP_ERROR_RXOVF:
    // RX overflow observed during operation
    break;
    default:
    // Uncaught error event - these could come from the
    // pool of states defined in rf_mailbox.h
    while(1);
    }

    while(1);
    }

    void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
    if (e & RF_EventRxEntryDone)
    {
    /* Toggle pin to indicate RX */
    PIN_setOutputValue(ledPinHandle, Board_PIN_LED2,
    !PIN_getOutputValue(Board_PIN_LED2));

    /* 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 + the status byte to the packet variable */
    memcpy(packet, packetDataPointer, (packetLength + 1));

    RFQueue_nextEntry();
    }
    }

  • 我测试没有问题,可以连续接收100包,每次接收时Rx端板子上红色的LED都会切换

    检查你的步骤是否正确,参考这里的步骤

    https://dev.ti.com/tirex/content/simplelink_academy_cc13x0sdk_4_20_00_00/modules/prop_rf/prop_01_basic/prop_01_basic.html