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.

CC2650: How to get valid appended RSSI in fixed length mode, while length field is different in TX and RX side

Part Number: CC2650
Other Parts Discussed in Thread: CC1310,

Hi, 

My customer is using 2.4GHz proprietary mode in their application. Fixed length mode(pktConf.bVarLen = 1) is used to compatible with legacy devices. And customer wants to get RSSI value of each received packet.

When the packet length fields in TX and RX side are set to the same value, RF_cmdPropTx.pktLen = 10 and RF_cmdPropRx.maxPktLen = 10, the valid RSSI value is appended into the 11th byte(packet[10]=0xE5) of rx buffer.

In customer's application, two types of packet with different length are sent by the TX side, and fixed length mode should be used to compatible with legacy devices. So packet length fields in TX and RX side are set to different value, RF_cmdPropTx.pktLen = 10 and RF_cmdPropRx.maxPktLen = 16. Then, the payload can be received correctly, but the appended RSSI(the 17th byte in rx buffer, packet[16]=0xB6) seems invalid.

This issue can be reproduces based on example project rfPacketRx/rfPacketTx, attached are .c files I used in reproducing the issue.

I also did the same test with CC1310 launchpads, the appended RSSI is valid in both conditions(with same or different value in length field in TX and RX side).

In the TRM document, it says that "If pktConf.bVarLen is 0, the length is fixed, and the receiver assumes maxPktLen bytes after the sync word and before the CRC". So, it should work correctly even the TX and RX sides use different length value with fixed length mode.

Please help to answer below questions:

1. how to get valid appended RSSI in fixed length mode, while length field is different in TX and RX side?

2. if it is not possible to get valid RSSI appended, what the work around?

3. why CC26xx has this issue, while CC13xx does not?

7776.rfPacketTx.c
/*
 * Copyright (c) 2015-2016, Texas Instruments Incorporated
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * *  Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * *  Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * *  Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/***** Includes *****/
#include <stdlib.h>
#include <xdc/std.h>
#include <xdc/runtime/System.h>

#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>

/* Drivers */
#include <ti/drivers/rf/RF.h>
#include <ti/drivers/PIN.h>

/* Board Header files */
#include "Board.h"

#include "smartrf_settings/smartrf_settings.h"

/* Pin driver handle */
static PIN_Handle ledPinHandle;
static PIN_State ledPinState;

/*
 * Application LED pin configuration table:
 *   - All LEDs board LEDs are off.
 */
PIN_Config pinTable[] =
{
    Board_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    PIN_TERMINATE
};


/***** Defines *****/
#define TX_TASK_STACK_SIZE 1024
#define TX_TASK_PRIORITY   2

/* Packet TX Configuration */
#define PAYLOAD_LENGTH      10//30
#define PACKET_INTERVAL     (uint32_t)(4000000*0.5f) /* Set packet interval to 500ms */



/***** Prototypes *****/
static void txTaskFunction(UArg arg0, UArg arg1);



/***** Variable declarations *****/
static Task_Params txTaskParams;
Task_Struct txTask;    /* not static so you can see in ROV */
static uint8_t txTaskStack[TX_TASK_STACK_SIZE];

static RF_Object rfObject;
static RF_Handle rfHandle;

uint32_t time;
static uint8_t packet[PAYLOAD_LENGTH];
static uint16_t seqNumber;
static PIN_Handle pinHandle;


/***** Function definitions *****/
void TxTask_init(PIN_Handle inPinHandle)
{
    pinHandle = inPinHandle;

    Task_Params_init(&txTaskParams);
    txTaskParams.stackSize = TX_TASK_STACK_SIZE;
    txTaskParams.priority = TX_TASK_PRIORITY;
    txTaskParams.stack = &txTaskStack;
    txTaskParams.arg0 = (UInt)1000000;

    Task_construct(&txTask, txTaskFunction, &txTaskParams, NULL);
}

static void txTaskFunction(UArg arg0, UArg arg1)
{
    uint32_t time;
    RF_Params rfParams;
    RF_Params_init(&rfParams);

    RF_cmdPropTx.pktLen = PAYLOAD_LENGTH;
    RF_cmdPropTx.pPkt = packet;
    RF_cmdPropTx.startTrigger.triggerType = TRIG_ABSTIME;
    RF_cmdPropTx.startTrigger.pastTrig = 1;
    RF_cmdPropTx.startTime = 0;

    RF_cmdPropTx.pktConf.bUseCrc = 0;
    RF_cmdPropTx.pktConf.bVarLen = 0;

    /* 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);

    /* Get current time */
    time = RF_getCurrentTime();
    while(1)
    {
        /* Create packet with incrementing sequence number and random payload */
//        packet[0] = (uint8_t)(seqNumber >> 8);
//        packet[1] = (uint8_t)(seqNumber++);
        uint8_t i;
        for (i = 0; i < PAYLOAD_LENGTH; i++)
        {
            packet[i] = i;//rand();
        }

        /* Set absolute TX time to utilize automatic power management */
        time += PACKET_INTERVAL;
        RF_cmdPropTx.startTime = time;

        /* Send packet */
        RF_EventMask result = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0);
        if (!(result & RF_EventLastCmdDone))
        {
            /* Error */
            while(1);
        }

        PIN_setOutputValue(pinHandle, Board_LED1,!PIN_getOutputValue(Board_LED1));
    }
}

/*
 *  ======== main ========
 */
int main(void)
{
    /* Call board init functions. */
    Board_initGeneral();

    /* Open LED pins */
    ledPinHandle = PIN_open(&ledPinState, pinTable);
    if(!ledPinHandle)
    {
        System_abort("Error initializing board LED pins\n");
    }

    /* Initialize task */
    TxTask_init(ledPinHandle);

    /* Start BIOS */
    BIOS_start();

    return (0);
}
rfPacketRx.c
/*
 * Copyright (c) 2015-2016, Texas Instruments Incorporated
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * *  Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * *  Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * *  Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/***** Includes *****/
#include <stdlib.h>
#include <xdc/std.h>
#include <xdc/cfg/global.h>
#include <xdc/runtime/System.h>

#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>

/* Drivers */
#include <ti/drivers/rf/RF.h>
#include <ti/drivers/PIN.h>
#include <driverlib/rf_prop_mailbox.h>

/* Board Header files */
#include "Board.h"

#include "RFQueue.h"
#include "smartrf_settings/smartrf_settings.h"

#include <stdlib.h>

/* Pin driver handle */
static PIN_Handle ledPinHandle;
static PIN_State ledPinState;

/*
 * Application LED pin configuration table:
 *   - All LEDs board LEDs are off.
 */
PIN_Config pinTable[] =
{
    Board_LED2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    PIN_TERMINATE
};


/***** Defines *****/
#define RX_TASK_STACK_SIZE 1024
#define RX_TASK_PRIORITY   2

/* Packet RX Configuration */
#define DATA_ENTRY_HEADER_SIZE 8  /* Constant header size of a Generic Data Entry */
#define MAX_LENGTH             16//30 /* Max length byte the radio will accept */
#define NUM_DATA_ENTRIES       2  /* NOTE: Only two data entries supported at the moment */
#define NUM_APPENDED_BYTES     2  /* The Data Entries data field will contain:
                                   * 1 Header byte (RF_cmdPropRx.rxConf.bIncludeHdr = 0x1)
                                   * Max 30 payload bytes
                                   * 1 status byte (RF_cmdPropRx.rxConf.bAppendStatus = 0x1) */



/***** Prototypes *****/
static void rxTaskFunction(UArg arg0, UArg arg1);
static void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e);

/***** Variable declarations *****/
static Task_Params rxTaskParams;
Task_Struct rxTask;    /* not static so you can see in ROV */
static uint8_t rxTaskStack[RX_TASK_STACK_SIZE];

static RF_Object rfObject;
static RF_Handle rfHandle;

/* Buffer which contains all Data Entries for receiving data.
 * Pragmas are needed to make sure this buffer is 4 byte aligned (requirement from the RF Core) */
#if defined(__TI_COMPILER_VERSION__)
    #pragma DATA_ALIGN (rxDataEntryBuffer, 4);
        static uint8_t rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(NUM_DATA_ENTRIES,
                                                                 MAX_LENGTH,
                                                                 NUM_APPENDED_BYTES)];
#elif defined(__IAR_SYSTEMS_ICC__)
    #pragma data_alignment = 4
        static uint8_t rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(NUM_DATA_ENTRIES,
                                                                 MAX_LENGTH,
                                                                 NUM_APPENDED_BYTES)];
#elif defined(__GNUC__)
        static uint8_t rxDataEntryBuffer [RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(NUM_DATA_ENTRIES,
            MAX_LENGTH, NUM_APPENDED_BYTES)] __attribute__ ((aligned (4)));
#else
    #error This compiler is not supported.
#endif

/* Receive dataQueue for RF Core to fill in data */
static dataQueue_t dataQueue;
static rfc_dataEntryGeneral_t* currentDataEntry;
static uint8_t packetLength;
static uint8_t* packetDataPointer;

static PIN_Handle pinHandle;

static uint8_t packet[MAX_LENGTH + NUM_APPENDED_BYTES]; /* The length byte is stored in a separate variable */


/***** Function definitions *****/
void RxTask_init(PIN_Handle ledPinHandle) {
    pinHandle = ledPinHandle;

    Task_Params_init(&rxTaskParams);
    rxTaskParams.stackSize = RX_TASK_STACK_SIZE;
    rxTaskParams.priority = RX_TASK_PRIORITY;
    rxTaskParams.stack = &rxTaskStack;
    rxTaskParams.arg0 = (UInt)1000000;

    Task_construct(&rxTask, rxTaskFunction, &rxTaskParams, NULL);
}

static void rxTaskFunction(UArg arg0, UArg arg1)
{
    RF_Params rfParams;
    RF_Params_init(&rfParams);

    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 */
    RF_cmdPropRx.pQueue = &dataQueue;           /* Set the Data Entity queue for received data */
    RF_cmdPropRx.rxConf.bAutoFlushIgnored = 0;  /* Discard ignored packets from Rx queue */
    RF_cmdPropRx.rxConf.bAutoFlushCrcErr = 0;   /* Discard packets with CRC error from Rx queue */
    RF_cmdPropRx.maxPktLen = MAX_LENGTH;        /* Implement packet length filtering to avoid PROP_ERROR_RXBUF */
    RF_cmdPropRx.pktConf.bRepeatOk = 1;
    RF_cmdPropRx.pktConf.bRepeatNok = 1;

    RF_cmdPropRx.pktConf.bUseCrc = 0;
    RF_cmdPropRx.pktConf.bVarLen = 0;
    RF_cmdPropRx.rxConf.bAppendRssi = 1;
    RF_cmdPropRx.rxConf.bAppendStatus = 1;
    RF_cmdPropRx.rxConf.bIncludeCrc = 0;

    /* 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);

    /* Enter RX mode and stay forever in RX */
    RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, &callback, IRQ_RX_ENTRY_DONE);

    while(1);
}

void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
{
    if (e & RF_EventRxEntryDone)
    {
        /* Toggle pin to indicate RX */
        PIN_setOutputValue(pinHandle, Board_LED2,!PIN_getOutputValue(Board_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      = MAX_LENGTH;
        packetDataPointer = (uint8_t*)(&currentDataEntry->data);

        /* Copy the payload + the status byte to the packet variable */
        memcpy(packet, packetDataPointer, (packetLength + NUM_APPENDED_BYTES));

        RFQueue_nextEntry();
    }
}

/*
 *  ======== main ========
 */
int main(void)
{
    /* Call board init functions. */
    Board_initGeneral();

    /* Open LED pins */
    ledPinHandle = PIN_open(&ledPinState, pinTable);
    if(!ledPinHandle)
    {
        System_abort("Error initializing board LED pins\n");
    }

    /* Initialize task */
    RxTask_init(ledPinHandle);

    /* Start BIOS */
    BIOS_start();

    return (0);
}

  • When appending RSSI, the RSSI byte will always be appended after the CRC (if the CRC is appended. In your case it is not, and since you are using fixed length and set the length to 16, the RSSI will always be at index 16 in packet. there are no differences between CC13xx and CC26xx as long as both devices runs the prop API. why do you think that a value of 0xB6 is not valid?

    Remember that you can also monitor the RSSI in the output structure:

    static rfc_propRxOutput_t rxStatistics;
    .
    .
    .
    .
    RF_cmdPropRx.pOutput = (uint8_t*)&rxStatistics;

    BR

    Siri

  • Hi, Siri,

    Thanks for your reply.


    The RF settings are all the same in above test, the only difference is the RF_cmdPropRx.maxPktLen in RX side. The same launchpads are used in the test and also the launchpads keep in the same position during the test. So the RSSI should be the same, no matter RF_cmdPropRx.maxPktLen = 16 or RF_cmdPropRx.maxPktLen = 10.


    The TX side keeps sending packets with 10 bytes payload.
    When set RF_cmdPropRx.maxPktLen = 10, the RSSI is 0xE5(-27dbm).
    When set RF_cmdPropRx.maxPktLen = 16, the RSSI is 0xB6(-74dbm).


    Why the RSSI values differ so much?
    I also monitor the RSSI in the output structure, it has the save value with packet[RF_cmdPropRx.maxPktLen].

  • Hi, Siri,

    In above test, the TX power is 5dbm, which is the default setting in rfPacketTx example.

    Then I set the TX power to 0dbm by setting .txPower = 0x3161, and monitor the RSSI value in the RX side,
    When set RF_cmdPropRx.maxPktLen = 10, the RSSI is 0xE9(-23dbm).
    When set RF_cmdPropRx.maxPktLen = 16, the RSSI is 0xB6(-74dbm).

    The RSSI remains 0xB6 while the TX is 0dbm and 5dbm. That's why I think this value is not valid.
  • What is the RSSI in the output structure showing for the two cases?
    Unfortunately I am not in the office today so I do not have any CC2650 available, but I can do some testing tomorrow.
    Can you try to keep the fixed length = 16 on the RX side but increase the packet length to be 16 bytes or above on the TX side? Do you see the same thing then?
    The RSSI in the output structure is the RSSI when sync is found but I am not sure if the RSSI appended to the packet is the RSSI when sync is found or if it is calculated throughout the packet. If it is, this can explain why the RSSI is lower in the case where you transit 10 bytes but receives 16 (the 6 last bytes is noise at a low level). Since you see this behavior on the CC2650 but not on the CC13xx, it might be that they are using different overrides and that one of the overrides affects the RSSI. I would appreciate if you can provide me with the smartrf_settings files you are using for both CC1310 and CC2650.

    BR

    Siri
  • Hi, Siri,

    I have done the test as you recommended, and get below result.

    1. When RF_cmdPropTx.pktLen is equal or longer than RF_cmdPropRx.maxPktLen, the appended RSSI value is around -29dbm. And I think it is reasonable.

    2. When RF_cmdPropTx.pktLen is shorter than RF_cmdPropRx.maxPktLen, the appended RSSI value is fixed 0xB6.

    In all the test, the appended RSSI has the same value with RSSI in the output structure.

    Attached is the RF setting used in the tests.

    smartrf_settings_CC2650.c
    
    //*********************************************************************************
    // These settings have been generated for use with TI-RTOS and cc26xxware
    //
    // Generated by SmartRF Studio version 2.3.0
    // Tested with TI-RTOS version tirtos_simplelink_2_16_xx_xx
    //
    //*********************************************************************************
    
    
    //*********************************************************************************
    // Parameter summary
    // Address: aa-bb
    // Frequency: 2445.00000 MHz
    // Data Format: Serial mode disable
    // Deviation: 50.000 kHz
    // Packet Length Config: Variable
    // Max Packet Length: 128
    // Packet Length: 30
    // RX Filter BW: 220 kHz
    // Symbol Rate: 50.00000 kBaud
    // Sync Word Length: 32 Bits
    // TX Power: 5 dBm
    // Whitening: No whitening
    
    #include <driverlib/rf_mailbox.h>
    #include <driverlib/rf_common_cmd.h>
    #include <driverlib/rf_prop_cmd.h>
    #include <ti/drivers/rf/RF.h>
    #include <rf_patches/rf_patch_cpe_genfsk.h>
    #include <rf_patches/rf_patch_rfe_genfsk.h>
    #include <rf_patches/rf_patch_mce_genfsk.h>
    #include "smartrf_settings.h"
    
    
    // TI-RTOS RF Mode Object
    RF_Mode RF_prop =
    {
        .rfMode = RF_MODE_PROPRIETARY_2_4,
        .cpePatchFxn = &rf_patch_cpe_genfsk,
        .mcePatchFxn = &rf_patch_mce_genfsk,
        .rfePatchFxn = &rf_patch_rfe_genfsk,
    };
    
    
    uint32_t shape[] = {0x00000000, 0x00000000, 0x00000000, 0x360c0100, 0xacaba076, 0xacacacac};
    
    
    // Overrides for CMD_PROP_RADIO_SETUP
    uint32_t pOverrides[] = {
            MCE_RFE_OVERRIDE(1,0,0,1,0,0),
            HW_REG_OVERRIDE(0x4038,0x34),
            HW_REG_OVERRIDE(0x6088,0x3F1F),
            HW_REG_OVERRIDE(0x608C,0x8213),
            HW32_ARRAY_OVERRIDE(0x405C,1),
            (uint32_t) 0x1801F800,
            HW32_ARRAY_OVERRIDE(0x402C,1),
            (uint32_t) 0x00608402,
            (uint32_t) 0xc0040031,
            (uint32_t) &shape[0],
            (uint32_t) 0x00000343,
            (uint32_t) 0x001000a3,
            (uint32_t) 0x000484a3,
            (uint32_t) 0x1c8f0583,
            (uint32_t) 0x1c8f0543,
            (uint32_t) 0x65980603,
            (uint32_t) 0x00020623,
            (uint32_t) 0x659805c3,
            (uint32_t) 0x000205e3,
            (uint32_t) 0x02010403,
            HW32_ARRAY_OVERRIDE(0x4034,1),
            (uint32_t) 0x177F0408,
            (uint32_t) 0x00008463,
            (uint32_t) 0x00388473,
            (uint32_t) 0x00F388a3,
            (uint32_t)0xFFFFFFFF,
    };
    
    // CMD_PROP_RADIO_SETUP
    rfc_CMD_PROP_RADIO_SETUP_t RF_cmdPropRadioDivSetup =
    {
        .commandNo = 0x3806,
        .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,
        .modulation.modType = 0x1,
        .modulation.deviation = 200,
        .symbolRate.preScale = 15,
        .symbolRate.rateWord = 131072,
        .rxBw = 7,
        .preamConf.nPreamBytes = 0x8,
        .preamConf.preamMode = 0x0,
        .formatConf.nSwBits = 16,
        .formatConf.bBitReversal = 0x0,
        .formatConf.bMsbFirst = 0x1,
        .formatConf.fecMode = 0x0,
        .formatConf.whitenMode = 0x0,
        .config.frontEndMode = 0x0,
        .config.biasMode = 0x0,
        .config.analogCfgMode = 0x0,
        .config.bNoFsPowerUp = 0x0,
        .txPower = 0x3161,//0x9324,
        .pRegOverride = pOverrides,
    };
    
    // CMD_FS
    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 = 2440,
        .fractFreq = 0x0000,
        .synthConf.bTxMode = 1,
        .synthConf.refFreq = 0x0,
    };
    
    // CMD_PROP_TX
    rfc_CMD_PROP_TX_t RF_cmdPropTx =
    {
        .commandNo = 0x3801,
        .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 = 0x1,
        .pktConf.bVarLen = 0x1,
        .pktLen = 0x1e, // SET APPLICATION PAYLOAD LENGTH
        .syncWord = 0xD391D391,
        .pPkt = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    };
    
    // CMD_PROP_RX
    rfc_CMD_PROP_RX_t RF_cmdPropRx =
    {
        .commandNo = 0x3802,
        .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,
        .pktConf.bVarLen = 0x1,
        .pktConf.bChkAddress = 0x0,
        .pktConf.endType = 0x0,
        .pktConf.filterOp = 0x0,
        .rxConf.bAutoFlushIgnored = 0x0,
        .rxConf.bAutoFlushCrcErr = 0x0,
        .rxConf.bIncludeHdr = 0x1,
        .rxConf.bIncludeCrc = 0x0,
        .rxConf.bAppendRssi = 0x0,
        .rxConf.bAppendTimestamp = 0x0,
        .rxConf.bAppendStatus = 0x1,
        .syncWord = 0xD391D391,
        .maxPktLen = 0x7d, // MAKE SURE DATA ENTRY IS LARGE ENOUGH
        .address0 = 0xaa,
        .address1 = 0xbb,
        .endTrigger.triggerType = 0x1,
        .endTrigger.bEnaCmd = 0x0,
        .endTrigger.triggerNo = 0x0,
        .endTrigger.pastTrig = 0x0,
        .endTime = 0x00000000,
        .pQueue = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx
        .pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    };
    
    // CMD_TX_TEST
    rfc_CMD_TX_TEST_t RF_cmdTxTest =
    {
            .commandNo = 0x0808,
            .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,
            .config.bUseCw = 0x0,
            .config.bFsOff = 0x0,
            .config.whitenMode = 0x2,
            .__dummy0 = 0x00,
            .txWord = 0xabcd,
            .__dummy1 = 0x00,
            .endTrigger.triggerType = 0x1,
            .endTrigger.bEnaCmd = 0x0,
            .endTrigger.triggerNo = 0x0,
            .endTrigger.pastTrig = 0x0,
            .syncWord = 0x930b51de,
            .endTime = 0x00000000,
    };
    

    smartrf_settings_CC1310.c
    
    //*********************************************************************************
    // Generated by SmartRF Studio version 2.6.0 (build #81)
    // Tested for SimpleLink SDK version: CC13x0 SDK 1.0.xx
    // Device: CC1310 Rev. 2.1
    //
    //*********************************************************************************
    
    
    //*********************************************************************************
    // Parameter summary
    // Address: off
    // Address0: 0xAA
    // Address1: 0xBB
    // Frequency: 868.00000 MHz
    // Data Format: Serial mode disable
    // Deviation: 25.000 kHz
    // Packet Length Config: Variable
    // Max Packet Length: 128
    // Packet Length: 20
    // RX Filter BW: 98 kHz
    // Symbol Rate: 50.00000 kBaud
    // Sync Word Length: 32 Bits
    // TX Power: 14 dBm (requires define CCFG_FORCE_VDDR_HH = 1 in ccfg.c, see CC13xx/CC26xx Technical Reference Manual)
    // Whitening: No whitening
    
    
    #include <ti/devices/DeviceFamily.h>
    #include DeviceFamily_constructPath(driverlib/rf_mailbox.h)
    #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
    #include DeviceFamily_constructPath(driverlib/rf_prop_cmd.h)
    #include <ti/drivers/rf/RF.h>
    #include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_genfsk.h)
    #include DeviceFamily_constructPath(rf_patches/rf_patch_rfe_genfsk.h)
    #include "smartrf_settings.h"
    
    
    // TI-RTOS RF Mode Object
    RF_Mode RF_prop =
    {
        .rfMode = RF_MODE_PROPRIETARY_SUB_1,
        .cpePatchFxn = &rf_patch_cpe_genfsk,
        .mcePatchFxn = 0,
        .rfePatchFxn = &rf_patch_rfe_genfsk,
    };
    
    // Overrides for CMD_PROP_RADIO_DIV_SETUP
    static uint32_t pOverrides[] =
    {
        // override_use_patch_prop_genfsk.xml
        // PHY: Use MCE ROM bank 4, RFE RAM patch
        MCE_RFE_OVERRIDE(0,4,0,1,0,0),
        // override_synth_prop_863_930_div5.xml
        // Synth: Set recommended RTRIM to 7
        HW_REG_OVERRIDE(0x4038,0x0037),
        // Synth: Set Fref to 4 MHz
        (uint32_t)0x000684A3,
        // Synth: Configure fine calibration setting
        HW_REG_OVERRIDE(0x4020,0x7F00),
        // Synth: Configure fine calibration setting
        HW_REG_OVERRIDE(0x4064,0x0040),
        // Synth: Configure fine calibration setting
        (uint32_t)0xB1070503,
        // Synth: Configure fine calibration setting
        (uint32_t)0x05330523,
        // Synth: Set loop bandwidth after lock to 20 kHz
        (uint32_t)0x0A480583,
        // Synth: Set loop bandwidth after lock to 20 kHz
        (uint32_t)0x7AB80603,
        // Synth: Configure VCO LDO (in ADI1, set VCOLDOCFG=0x9F to use voltage input reference)
        ADI_REG_OVERRIDE(1,4,0x9F),
        // Synth: Configure synth LDO (in ADI1, set SLDOCTL0.COMP_CAP=1)
        ADI_HALFREG_OVERRIDE(1,7,0x4,0x4),
        // Synth: Use 24 MHz XOSC as synth clock, enable extra PLL filtering
        (uint32_t)0x02010403,
        // Synth: Configure extra PLL filtering
        (uint32_t)0x00108463,
        // Synth: Increase synth programming timeout (0x04B0 RAT ticks = 300 us)
        (uint32_t)0x04B00243,
        // override_phy_rx_aaf_bw_0xd.xml
        // Rx: Set anti-aliasing filter bandwidth to 0xD (in ADI0, set IFAMPCTL3[7:4]=0xD)
        ADI_HALFREG_OVERRIDE(0,61,0xF,0xD),
        // override_phy_gfsk_rx.xml
        // Rx: Set LNA bias current trim offset to 3
        (uint32_t)0x00038883,
        // Rx: Freeze RSSI on sync found event
        HW_REG_OVERRIDE(0x6084,0x35F1),
        // override_phy_gfsk_pa_ramp_agc_reflevel_0x1a.xml
        // Tx: Configure PA ramping setting (0x41). Rx: Set AGC reference level to 0x1A.
        HW_REG_OVERRIDE(0x6088,0x411A),
        // Tx: Configure PA ramping setting
        HW_REG_OVERRIDE(0x608C,0x8213),
        // override_phy_rx_rssi_offset_5db.xml
        // Rx: Set RSSI offset to adjust reported RSSI by +5 dB
        (uint32_t)0x00FB88A3,
    #if (CCFG_FORCE_VDDR_HH)
        // TX power override
        // Tx: Set PA trim to max (in ADI0, set PACTL0=0xF8)
        ADI_REG_OVERRIDE(0,12,0xF8),
    #endif
        (uint32_t)0xFFFFFFFF,
    };
    
    
    // CMD_PROP_RADIO_DIV_SETUP
    rfc_CMD_PROP_RADIO_DIV_SETUP_t RF_cmdPropRadioDivSetup =
    {
        .commandNo = 0x3807,
        .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,
        .modulation.modType = 0x1,
        .modulation.deviation = 0x64,
        .symbolRate.preScale = 0xF,
        .symbolRate.rateWord = 0x8000,
        .rxBw = 0x24,
        .preamConf.nPreamBytes = 0x4,
        .preamConf.preamMode = 0x0,
        .formatConf.nSwBits = 0x20,
        .formatConf.bBitReversal = 0x0,
        .formatConf.bMsbFirst = 0x1,
        .formatConf.fecMode = 0x0,
        .formatConf.whitenMode = 0x0,
        .config.frontEndMode = 0x0,
        .config.biasMode = 0x1,
        .config.analogCfgMode = 0x0,
        .config.bNoFsPowerUp = 0x0,
        .txPower = 0xA73F,
        .pRegOverride = pOverrides,
        .centerFreq = 0x0364,
        .intFreq = 0x8000,
        .loDivider = 0x05,
    };
    
    // CMD_FS
    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 = 0x0364,
        .fractFreq = 0x0000,
        .synthConf.bTxMode = 0x0,
        .synthConf.refFreq = 0x0,
        .__dummy0 = 0x00,
        .__dummy1 = 0x00,
        .__dummy2 = 0x00,
        .__dummy3 = 0x0000,
    };
    
    // CMD_PROP_TX
    rfc_CMD_PROP_TX_t RF_cmdPropTx =
    {
        .commandNo = 0x3801,
        .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 = 0x1,
        .pktConf.bVarLen = 0x1,
        .pktLen = 0x14, // SET APPLICATION PAYLOAD LENGTH
        .syncWord = 0x930B51DE,
        .pPkt = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    };
    
    // CMD_PROP_RX
    rfc_CMD_PROP_RX_t RF_cmdPropRx =
    {
        .commandNo = 0x3802,
        .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,
        .pktConf.bVarLen = 0x1,
        .pktConf.bChkAddress = 0x0,
        .pktConf.endType = 0x0,
        .pktConf.filterOp = 0x0,
        .rxConf.bAutoFlushIgnored = 0x0,
        .rxConf.bAutoFlushCrcErr = 0x0,
        .rxConf.bIncludeHdr = 0x1,
        .rxConf.bIncludeCrc = 0x0,
        .rxConf.bAppendRssi = 0x0,
        .rxConf.bAppendTimestamp = 0x0,
        .rxConf.bAppendStatus = 0x1,
        .syncWord = 0x930B51DE,
        .maxPktLen = 0x80, // MAKE SURE DATA ENTRY IS LARGE ENOUGH
        .address0 = 0xAA,
        .address1 = 0xBB,
        .endTrigger.triggerType = 0x1,
        .endTrigger.bEnaCmd = 0x0,
        .endTrigger.triggerNo = 0x0,
        .endTrigger.pastTrig = 0x0,
        .endTime = 0x00000000,
        .pQueue = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx
        .pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    };
    
    // CMD_TX_TEST
    rfc_CMD_TX_TEST_t RF_cmdTxTest =
    {
        .commandNo = 0x0808,
        .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,
        .config.bUseCw = 0x0,
        .config.bFsOff = 0x1,
        .config.whitenMode = 0x2,
        .__dummy0 = 0x00,
        .txWord = 0xABCD,
        .__dummy1 = 0x00,
        .endTrigger.triggerType = 0x1,
        .endTrigger.bEnaCmd = 0x0,
        .endTrigger.triggerNo = 0x0,
        .endTrigger.pastTrig = 0x0,
        .syncWord = 0x930B51DE,
        .endTime = 0x00000000,
    };
    

  • Hi

    I will do some testing when I am back in the office tomorrow, but in the mean time, can you try to add the following override:

    HW_REG_OVERRIDE(0x6084, 0x35F1)

    Add it right before the (uint32_t)0xFFFFFFFF, override. This should make sure that the RSSI is not beeing updated after sync is found.

    BR

    Siri
  • I have now done some testing. Use the override HW_REG_OVERRIDE(0x6084, 0x34F1), and not HW_REG_OVERRIDE(0x6084, 0x35F1), and the RSSI will freeze on Sync found.

    BR

    Siri
  • Hi, Siri,

    Thanks very much for your support.

    I can get valid RSSI with both "HW_REG_OVERRIDE(0x6084, 0x34F1)" and "HW_REG_OVERRIDE(0x6084, 0x35F1)"

    What's the different between this two override? I also checked that CC1310 settings used "HW_REG_OVERRIDE(0x6084, 0x35F1)".
  • There are 3 bits internally that is used to modify some AGC Hysteresis settings. The CC2650 uses the default setting of 4 for these bits while the CC1310 overrides this and set it to 5. The setting I first sent you was for CC1310 and CC2650. settings these bits to 5 on the CC2650 will also work, but you should use 4 as this is what we have been testing with.

    Siri
  • Hi, Siri,

    Got it, thanks for your explanation.