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.

CCS/CC2640R2F: CC2640R2F rfPacketTX working mode question(BLE or Proprietary)

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC1350

Tool/software: Code Composer Studio

Hello guys:

I have a question with C:\ti\simplelink_cc2640r2_sdk_3_10_00_15\examples\rtos\CC2640R2_LAUNCHXL\drivers\rfPacketTx details shown below:

my testing structure:
Board A is LAUNCHXL_CC2640R2F with rfPacketTx program running on it  ----------send packet-------->>>>>>>>   Board B is LAUNCHXL_CC2640R2F connect to SmartRF studio 7 and setting to BLE RX mode or Proprietary RX mode

my questions:

1: When rfPacketTx working on board A, The board B can received packets in BLE mode on channel 37 ~ 39

(

2402MHz #37 channel RSSI = -50.4dBm
2426 MHz #38 Channel RSSI = -50.1dBm
2480MHz #39 channel RSSI = -48.4dBm

)

but channel 0~36 can not receive any packets, But in code smartrf_settings.c  the working frequency setting is 2440MHz, so

why the working frequency does not match(2440MHz send and 2402MHz,2426MHz,2480MHz receive)but packets can be received;

// CMD_FS
// Frequency Synthesizer Programming Command
rfc_CMD_FS_t RF_cmdFs =
{
    .commandNo = 0x0803,
    .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,
    .frequency = 0x0988,     /*0x0998 is 2440 so I think this is the frequency setting code for CC2640R2F*/
    .fractFreq = 0x0000,
    .synthConf.bTxMode = 0x0,
    .synthConf.refFreq = 0x0,
    .__dummy0 = 0x00,
    .__dummy1 = 0x00,
    .__dummy2 = 0x00,
    .__dummy3 = 0x0000,
};  

2: When rfPacketTx working on board A, The board B can received packet in proprietary mode on 250kbps,2-GFSK, 125KHz deviation status, But in 100kbps,2-GFSK, 50KHZ deviation can not receive any packets, Why 100kbps can not working??

3: Which working mode for CC2640R2F set in project rfPacketTx BLE Mode or Proprietary Mode  , I have not find the code for working mode setting, Where can I find the code???

  • The rfPacketTX example does only support proprietary packets, and you cannot configure a receiver for BLE mode with SmartRF Studio and expect packets to be received. What you receive on channel 37-39 are advertising packets and are not the packets you send with using the rfPacketTX example.

    The rfPacketTx example are using the 250 kbps settings in Studio as default. If you want to change to 100 kbps, you need to do a code export in SmartRF Studio, and replace the old settings in smartrf_settings.c with the new 100 kbps settings.

    BR

    Siri

  • Hi, Siri:

    Thanks for your feedback!!

    Now I have modify the rfPacketTx.c in order to sent out my own data packet, I have set the packet as

    "Hello world!! for CC2640R2F" --------------------sent packet from board A

    "llo world! for CC2640R2F" ------------------------received packet got by board B

    there are two chars "He" has lost in transceiver side, I have checked the code in rfPackTx.c which shown belwo:


    /***** Variable declarations *****/
    static RF_Object rfObject;
    static RF_Handle rfHandle;
    /* Pin driver handle */
    static PIN_Handle ledPinHandle;
    static PIN_State ledPinState;
    static uint8_t packet[PAYLOAD_LENGTH];
    static uint16_t seqNumber;   ///************************************** here the code defined the seqNumber but not set the value for it ***********************///
    /*
     * Application LED pin configuration table:
     *   - All LEDs board LEDs are off.
     */
    PIN_Config pinTable[] =
    {
        Board_PIN_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    #ifdef POWER_MEASUREMENT
    #if defined(Board_CC1350_LAUNCHXL)
        Board_DIO30_SWPWR | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    #endif
    #endif
        PIN_TERMINATE
    };
    /***** Function definitions *****/
    void *mainThread(void *arg0)
    {
        RF_Params rfParams;
        RF_Params_init(&rfParams);
        /* Open LED pins */
        ledPinHandle = PIN_open(&ledPinState, pinTable);
        if (ledPinHandle == NULL)
        {
            while(1);
        }
    #ifdef POWER_MEASUREMENT
    #if defined(Board_CC1350_LAUNCHXL)
        /* Route out PA active pin to Board_DIO30_SWPWR */
        PINCC26XX_setMux(ledPinHandle, Board_DIO30_SWPWR, PINCC26XX_MUX_RFC_GPO1);
    #endif
    #endif
        RF_cmdPropTx.pktLen = PAYLOAD_LENGTH; 
        RF_cmdPropTx.pPkt = packet; 
        RF_cmdPropTx.startTrigger.triggerType = TRIG_NOW;
        /* 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);
        while(1)
        {
            /* Create packet with incrementing sequence number and random payload */
            packet[0] = (uint8_t)(seqNumber >> 8);   //******************* here the code feed the packet[0] with seqNumber >> 8, it is a random number in RAM, what 
                                                                             //*******************  is the meaning in this section to right shift 8 times for a random number????
            packet[1] = (uint8_t)(seqNumber++);      
            uint8_t i;
            for (i = 2; i < PAYLOAD_LENGTH; i++)   //******************* Why the code start to feed the packet[] array with rand() function's result from packet[2],
                                                                                                          Dose the  real payload packet start from packet[2] and end of packet[29] (if the length is 30)
            {
                packet[i] = rand();
            }
            /* Send packet */
            RF_EventMask terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx,
                                                       RF_PriorityNormal, NULL, 0);
  • Hi,Siri:

    thanks for your comments!!

    I have modified the rfPacketTx.x code and replace the rand() data packet with my own data packet[]="Hellow World ! for CC2640R2F"; But just received "llow World! for CC2640R2F", There are two chars lost in transceiver side, How can I find it back??? Below is my received raw data:

    16:23:05.831 | 1e | 18533 | 6c 6c 6f 77 20 57 6f 72 6c 64 21 20 66 6f 72 20 43 43 32 36 34 30 52 32 46 00 03 08 | -49
    16:23:06.336 | 1e | 18533 | 6c 6c 6f 77 20 57 6f 72 6c 64 21 20 66 6f 72 20 43 43 32 36 34 30 52 32 46 00 03 08 | -50
    16:23:06.838 | 1e | 18533 | 6c 6c 6f 77 20 57 6f 72 6c 64 21 20 66 6f 72 20 43 43 32 36 34 30 52 32 46 00 03 08 | -50
    16:23:07.341 | 1e | 18533 | 6c 6c 6f 77 20 57 6f 72 6c 64 21 20 66 6f 72 20 43 43 32 36 34 30 52 32 46 00 03 08 | -50
    16:23:07.846 | 1e | 18533 | 6c(l) 6c(l) 6f(o) 77(w) 20(NULL) 57(W) 6f(o) 72(r) 6c (l) 64(d) 21(!) 20(NULL) 66(f) 6f(o) 72(r) 20(NULL) 43(C) 43(C) 32(2) 36 (6)34(4) 30(0) 52(R) 32(2) 46(F) 00(NULL) 03(ETX) 08(BS) | -50
    in the code:
    73:   static uint8_t packet[PAYLOAD_LENGTH];
    74:   static uint16_t seqNumber;   // here defined a uint16_t variable segNumber but not set the value in it
    .......
    .......
    /* Set the frequency */
        RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
        while(1)
        {
            /* Create packet with incrementing sequence number and random payload */
            packet[0] = (uint8_t)(seqNumber >> 8);       // here the code used the seqNumber to feed packet[0], why it right shift 8 times for a random number
            packet[1] = (uint8_t)(seqNumber++);
            uint8_t i;
            for (i = 2; i < PAYLOAD_LENGTH; i++)       // here start use rand() output to feed packet array, does the real payload start from
                                                                                //  packet[2] and end to packet[29] ???
            {
                packet[i] = rand();
            }
            /* Send packet */
            RF_EventMask terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx,
                                                       RF_PriorityNormal, NULL, 0);

  • You need to turn off "Seq. Number included in the Payload"

    Siri