CC1310: how to transmit and receive data more than 255 byte using the TX_ADV and RX_ADV comman

Part Number: CC1310

Hello All,

I am triying to  transmit and receive data which is 1000 byte. so PAYLOAD_LENGTH is 1000

As you can see the code below, I split my payload length as a 

RF_Buffer[1]=(uint8_t)(PAYLOAD_LENGTH >> 8);
RF_Buffer[0]=(uint8_t)(PAYLOAD_LENGTH);

so,

RF_Buffer[0] become 232 which is 1110 1000 

RF_Buffer[1] become 3 which is 0011.

void txTaskFunction(UArg arg0, UArg arg1)
{
    uint8_t divided_by = 0;
    uint16_t index, index_2;
    uint32_t RFtime;
    RF_Params rfParams;
    RF_Params_init(&rfParams);

    RF_cmdPropTxAdv.pktLen = PAYLOAD_LENGTH+2;
    RF_cmdPropTxAdv.pPkt = RF_Buffer;
    RF_cmdPropTxAdv.startTrigger.triggerType = TRIG_ABSTIME;
    RF_cmdPropTxAdv.startTrigger.pastTrig = 1;

    if (!rfHandle){
        rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
        RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
    }

    RFtime = RF_getCurrentTime();

    while(1)
    {
        Semaphore_pend(semTxHandle, BIOS_WAIT_FOREVER);
        {
           {
                RF_Buffer[1]=(uint8_t)(PAYLOAD_LENGTH >> 8);
                RF_Buffer[0]=(uint8_t)(PAYLOAD_LENGTH);

//                for(index_2 = 2; index_2 < PAYLOAD_LENGTH+2; index_2 ++)
//                {
//                    RF_Buffer[index_2] = ALL_Buffer[index_2-2];
//                }

                uint16_t i;
                for (i = 2; i < PAYLOAD_LENGTH + 2; i++)
                {
                    RF_Buffer[i] = i-1;//rand();
                }

                RFtime += PACKET_INTERVAL;
                RF_cmdPropTxAdv.startTime = RFtime;

//                rfTxCmd = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropTxAdv, RF_PriorityNormal, NULL, 0);
//
//                RF_EventMask result = RF_pendCmd(rfHandle, rfTxCmd, (RF_EventCmdDone | RF_EventCmdError | RF_EventLastCmdDone |
//                         RF_EventCmdAborted | RF_EventCmdCancelled | RF_EventCmdStopped));

                /* Send packet */
                RF_EventMask result = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTxAdv, RF_PriorityNormal, NULL, 0);

                if (!(result & RF_EventLastCmdDone))
                {   while(1);}
//                memset(RF_Buffer, 0, sizeof(RF_Buffer));
            }
            index = 0;
//            memset(ALL_Buffer, 0, sizeof(ALL_Buffer));
            PIN_setOutputValue(hPin, STA_LED,!PIN_getOutputValue(STA_LED));
        }
    }
}

you can also see smartrf_setting.c file below.

// CMD_PROP_TX_ADV
// Proprietary Mode Advanced Transmit Command
rfc_CMD_PROP_TX_ADV_t RF_cmdPropTxAdv =
{
    .commandNo = 0x3803,
    .status = 0x0000,
    .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    .startTime = 0x00000000,
    .startTrigger.triggerType = 0x0,
    .startTrigger.bEnaCmd = 0x0,
    .startTrigger.triggerNo = 0x0,
    .startTrigger.pastTrig = 0x0,
    .condition.rule = 0x1,
    .condition.nSkip = 0x0,
    .pktConf.bFsOff = 0x0,
    .pktConf.bUseCrc = 0x0,
    .pktConf.bCrcIncSw = 0x0,
    .pktConf.bCrcIncHdr = 0x0,
    .numHdrBits = 0x00,
    .pktLen = 0x1FFF,
    .startConf.bExtTxTrig = 0x0,
    .startConf.inputMode = 0x0,
    .startConf.source = 0x0,
    .preTrigger.triggerType = 0x0,
    .preTrigger.bEnaCmd = 0x0,
    .preTrigger.triggerNo = 0x0,
    .preTrigger.pastTrig = 0x0,
    .preTime = 0x00000000,
    .syncWord = 0x930B51DE,
    .pPkt = 0 // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
};



// CMD_PROP_RX_ADV
rfc_CMD_PROP_RX_ADV_t RF_cmdPropRxAdv =
{
    .commandNo = 0x3804,
    .status = 0x0000,
    .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    .startTime = 0x00000000,
    .startTrigger.triggerType = 0x0,
    .startTrigger.bEnaCmd = 0x0,
    .startTrigger.triggerNo = 0x0,
    .startTrigger.pastTrig = 0x0,
    .condition.rule = 0x1,
    .condition.nSkip = 0x0,

    .pktConf.bFsOff = 0x0,
    .pktConf.bRepeatOk = 0x0,
    .pktConf.bRepeatNok = 0x0,
    .pktConf.bUseCrc = 0x1, //1 DE OLSA 0 OLSA ALIYOR
    .pktConf.bCrcIncSw = 0x0,
    .pktConf.bCrcIncHdr = 0x0,

    .pktConf.endType = 0x0,
    .pktConf.filterOp = 0x0,

    .rxConf.bAutoFlushIgnored = 0x0,
    .rxConf.bAutoFlushCrcErr = 0x0,
    .rxConf.bIncludeHdr = 0x1,
    .rxConf.bIncludeCrc = 0x0, //1 OLUNCA ALMIYOR
    .rxConf.bAppendRssi = 0x0,
    .rxConf.bAppendTimestamp = 0x0,
    .rxConf.bAppendStatus = 0x1, //1000 için 0 yap. 300 için 1 kalabilir

    .syncWord0 = 0x930B51DE,
    .syncWord1 = 0x00000000,

    .maxPktLen = 0x0000,

    .hdrConf.numHdrBits = 16,
    .hdrConf.lenPos = 0x0,
    .hdrConf.numLenBits = 16,

    .addrConf.addrType = 0x0,
    .addrConf.addrSize = 0x0,
    .addrConf.addrPos = 0x0,
    .addrConf.numAddr = 0x0,

    .lenOffset = 0x00,
    .endTrigger.triggerType = 0x1,
    .endTrigger.bEnaCmd = 0x0,
    .endTrigger.triggerNo = 0x0,
    .endTrigger.pastTrig = 0x0,
    .endTime = 0x00000000,

    .pAddr = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    .pQueue = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx
    .pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
};


When I am trying to transmitter, I am only able to receive data which is first 232 byte of RF_buffer. But I can not recieve other datas.

What may it cause to this problem? Can you please help me to solve this problem?

BR

Bekir

  • Hi Bekir,

    Thanks for your question, we'll look into this and get back to you with an update.

    Thanks, 
    Elin 

  • Hi Elin,

    Thank you for your answer. I found the problem what it is. The problem was in packet length setting in the callback function. I mean I didnt fix the packet length and packet data pointer . Now I fixed it you can see the code below. 

    void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
        if (e & RF_EventRxEntryDone)
        {
            /* 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)) | (*(uint8_t*)(&currentDataEntry->data + 1) << 8);
            packetDataPointer = (uint8_t*)(&currentDataEntry->data + 2);
    
            /* Copy the payload + the status byte to the packet variable */
            memcpy(packet, packetDataPointer, (packetLength + 1));
    
                /* Toggle pin to indicate RX */
                PIN_setOutputValue(pinHandle, Board_LED2,!PIN_getOutputValue(Board_LED2));
                packetReady = 1;
                RF_Rssi_val = rxStatistics.lastRssi; 
    
            RFQueue_nextEntry();
    
            Semaphore_post(semUartRxHandle);
        }
    }

    thanks 

    Bekir