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/CC1310: LBT Example not working

Part Number: CC1310
Other Parts Discussed in Thread: CC2510

Tool/software: Code Composer Studio

Hello,

I am unable to get the rfListenBeforeTalk example to work unmodified. It seems to crash during

RF_runCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);

Even when running on a Launchpad for the CC1310

Additionally, I have tried implementing the example into my own already, and whilst I get past the setting of the frequency, my code crashes when running the RF_runCmd for the RF_cmdNop:

RF_flushCmd(rfHandle, RF_CMDHANDLE_FLUSH_ALL, 0);
RF_close(rfHandle);

    /* Initialize the radio */
    RF_Params rfParams;
    RF_Params_init(&rfParams);

        RF_cmdNop.startTrigger.pastTrig = 1;
        RF_cmdNop.startTrigger.triggerType = TRIG_NOW ;
        RF_cmdNop.startTime = 0;

        /* Set up the next pointers for the command chain */
        RF_cmdNop.pNextOp = (rfc_radioOp_t*) &RF_cmdPropCs;
        RF_cmdPropCs.pNextOp = (rfc_radioOp_t*) &RF_cmdCountBranch;
        RF_cmdCountBranch.pNextOp = (rfc_radioOp_t*) &RF_cmdPropTxAdv;
        RF_cmdCountBranch.pNextOpIfOk = (rfc_radioOp_t*) &RF_cmdPropCs;

        /* Customize the API commands with application specific defines */
        RF_cmdPropCs.rssiThr = RSSI_THRESHOLD_DBM;
        RF_cmdPropCs.csEndTime = (IDLE_TIME_US + 150) * 4; /* Add some margin */
        RF_cmdCountBranch.counter = CS_RETRIES_WHEN_BUSY;
    
    /* Set application specific fields */
    RF_cmdPropTxAdv.pktLen = (uint16_t) (packet[0] + 1) & 0x00FF;
    RF_cmdPropTxAdv.pPkt = packet;

    /* Request access to the radio */
    rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*) &RF_cmdPropRadioDivSetup, &rfParams);

    /* Set the frequency */
    RF_runCmd(rfHandle, (RF_Op*) &RF_cmdFs, RF_PriorityNormal, NULL, 0);

    RF_EventMask terminationReason;

    /* Send packet */
    terminationReason = RF_runCmd(rfHandle, (RF_Op*) &RF_cmdNop, RF_PriorityNormal, NULL, RF_EventTxEntryDone);

My smart rf studio settings are:

uint32_t pOverrides[] =
{
// override_use_patch_wb_dsss.xml
    // PHY: Use MCE RAM patch, 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_synth_disable_bias_div5.xml
    // Synth: Set divider bias to disabled
    HW32_ARRAY_OVERRIDE(0x405C,1),
    // Synth: Set divider bias to disabled (specific for loDivider=5)
    (uint32_t)0x18000200,
    // 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_wb_dsss_spreading_8.xml
    // Set correlation threshold to 0x48
    HW_REG_OVERRIDE(0x5108,0x0048),
    // Enable PA ramping of 5 us and AGC reference level of 0x1E
    HW_REG_OVERRIDE(0x6088,0x1F1E),
    // Set spreading = 8, K = 4
    HW_REG_OVERRIDE(0x52AC,0x0F33),
    // Tx: Configure PA ramping setting (0x08) for approximately 5 us PA ramp time
    HW_REG_OVERRIDE(0x608C,0x3F13),
    // TX: set intFreq = 0
    (uint32_t)0x00000343,
    // override_phy_rx_rssi_offset_5db.xml
    // Rx: Set RSSI offset to adjust reported RSSI by +5 dB (default: 0), trimmed for external bias and differential configuration
    (uint32_t)0x00FB88A3,
    (uint32_t)0xFFFFFFFF
};

// CMD_PROP_RADIO_DIV_SETUP
// Proprietary Mode Radio Setup Command for All Frequency Bands
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 = 0x3C0,
    .symbolRate.preScale = 0xF,
    .symbolRate.rateWord = 0x4CCCD,
    .symbolRate.decimMode = 0x0,
    .rxBw = 0x2C,
    .preamConf.nPreamBytes = 0x5,
    .preamConf.preamMode = 0x1,
    .formatConf.nSwBits = 0x20,
    .formatConf.bBitReversal = 0x0,
    .formatConf.bMsbFirst = 0x0,
    .formatConf.fecMode = 0x8,
    .formatConf.whitenMode = 0x1,
    .config.frontEndMode = 0x0,
    .config.biasMode = 0x1,
    .config.analogCfgMode = 0x0,
    .config.bNoFsPowerUp = 0x0,
    .txPower = 0xA73F,
    .pRegOverride = pOverrides,
    .centerFreq = 0x0399,
    .intFreq = 0x0B33,
    .loDivider = 0x05
};


// 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 = 0x0393,
    .fractFreq = 0x0000,
    .synthConf.bTxMode = 0x0,
    .synthConf.refFreq = 0x0,
    .__dummy0 = 0x00,
    .__dummy1 = 0x00,
    .__dummy2 = 0x00,
    .__dummy3 = 0x0000
};

// 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 = 0x1,
    .pktConf.bCrcIncSw = 0x0,
    .pktConf.bCrcIncHdr = 0x0,
    .numHdrBits = 0x00,
    .pktLen = 0x001E,
    .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_NOP
// No Operation Command
rfc_CMD_NOP_t RF_cmdNop =
{
    .commandNo = 0x0801,
    .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 = 0x0,
    .condition.nSkip = 0x0
};


// CMD_PROP_CS
// Carrier Sense Command
rfc_CMD_PROP_CS_t RF_cmdPropCs =
{
    .commandNo = 0x3805,
    .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,
    .csFsConf.bFsOffIdle = 0x0,
    .csFsConf.bFsOffBusy = 0x0,
    .__dummy0 = 0x00,
    .csConf.bEnaRssi = 0x0,
    .csConf.bEnaCorr = 0x0,
    .csConf.operation = 0x0,
    .csConf.busyOp = 0x0,
    .csConf.idleOp = 0x0,
    .csConf.timeoutRes = 0x0,
    .rssiThr = 0x00,
    .numRssiIdle = 0x00,
    .numRssiBusy = 0x00,
    .corrPeriod = 0x0000,
    .corrConfig.numCorrInv = 0x0,
    .corrConfig.numCorrBusy = 0x0,
    .csEndTrigger.triggerType = 0x0,
    .csEndTrigger.bEnaCmd = 0x0,
    .csEndTrigger.triggerNo = 0x0,
    .csEndTrigger.pastTrig = 0x0,
    .csEndTime = 0x00000000
};


// CMD_COUNT_BRANCH
rfc_CMD_COUNT_BRANCH_t RF_cmdCountBranch =
{
    .commandNo                = CMD_COUNT_BRANCH,
    .status                   = 0x0000,
    .pNextOp                  = 0, // Set this to (uint8_t*)&RF_cmdPropTx in the application
    .startTime                = 0x00000000,
    .startTrigger.triggerType = TRIG_NOW, // Triggers immediately
    .startTrigger.bEnaCmd     = 0x0,
    .startTrigger.triggerNo   = 0x0,
    .startTrigger.pastTrig    = 0x0,
    .condition.rule           = COND_STOP_ON_FALSE, // Run next command if this command returned TRUE, stop if it returned FALSE
                                                    // End causes for the CMD_COUNT_BRANCH command:
                                                    // Finished operation with counter = 0 when being started: DONE_OK         TRUE
                                                    // Finished operation with counter > 0 after decrementing: DONE_OK         TRUE
                                                    // Finished operation with counter = 0 after decrementing: DONE_COUNTDOWN  FALSE
    .condition.nSkip          = 0x0,
    .counter                  = 0, // On start, the radio CPU decrements the value, and the end status of the operation differs if the result is zero
                                   // This number is set in the application (CS_RETRIES_WHEN_BUSY) and determines how many times the CMD_PROP_CS should run
                                   // in the case where the channel i Busy
    .pNextOpIfOk              = 0, // Set this to (uint8_t*)&RF_cmdPropCs in the application
};

Though I have tried lots of different settings and patches, currently trying to use:

RF_prop.cpePatchFxn = &rf_patch_cpe_genfsk;
    RF_prop.mcePatchFxn = 0;
    RF_prop.rfePatchFxn = &rf_patch_rfe_genfsk;

Thank you

  • Please provide information about SDK revision, CCS revision, and what HW revision you are running on (you can get the chip revision by connecting the LP and open it in SmartRF Studio)

    BR

    Siri

  • SDK:

    simplelink_cc13x0_sdk_3_10_00_11

    CCS:

    9.1.0.00010

    HW:

    SmartRF studio tells me it's a cc2510, but connecting to the SmartRF Flash Programmer 2 tells me it's a cc1310.

    In SmartRF Studio it tells me the Revision is E (0x04)

    The launchpad itself is Revision 1.4.1

    PG: 2.1

    FW Rev: 1.0

    Thank you,

    Greg

  • It should not be possible that SmartRF Studio reports that the CC1310 is a CC2510. Please send a picture of your LP and jumper settings, and also a screenshoot of SmartRF Studio with the LP connected.

    Siri

  • I apologise, I was mistaken. The CC1310 is read from SmartRF Studio correctly.

    It is Revision 2.1 (Rev B)

    Thank you,

    Greg

  • I tested the LBT example unmodified, and it works as expected. I also generated settings for WB-DSSS (30 kbps) and used these settings in the LBT example (unmodified WB-DSSS settings from Studio using code export), and it still worked. I tested that all packets were received with SmartRF Studio, and also that no packets were transmitted in the presence of a jammer.

    Your first step should be to get this up and running. If this is not working, there must be something wrong with the HW, as we know that the software is OK.

    One you have verified that the known good software is running on the HW, you can start to modify the code (if needed). I see that you are using the advances TX command instead of the normal TX command. Why are you doing that? Have you made sure that your TX command is set up correctly compared to your receive command?

    I also see that you are settings RF_cmdPropRadioDivSetup.centerFreq = 0x0399 but RF_cmdFs.frequency = 0x0393? Why are these different?

    My testing was done with simplelink_cc13x2_26x2_sdk_3_20_00_68, but there are not changes in the LBT example between the 3_10 and the 3_20 release.

    Siri

  • Hello Siri,

    I have been able to get my module to TX when using different settings that weren't LBT.

    In this program, I write to the RF_cmdFs, RF_cmdPropRadioDivSetup and RF_prop structures to change the settings. When posting the above, I forgot to include that the RF_cmdFs.frequency is changed as well already to 0x399.

    Additionally, I use Advanced TX because I wanted access to the pretriggers

    It is only when I use the LBT method that this does not work and the program crashes

    I have downloaded simplelink_cc13x0_sdk_3_20_00_23 and the example now works and I am now also able to get the LBT working inside my project. However, I am unable in both the project and example to get the wb_dsss working.

    In both cases when I change from:

    MCE_RFE_OVERRIDE(0,4,0,1,0,0),

    to:

    MCE_RFE_OVERRIDE(1,0,0,1,0,0)

    It begins to get lost during the runcmd on the Nop waiting for an interrupt.

    Here are my settings now for inside my modified example:

    //*********************************************************************************
    // Generated by SmartRF Studio version 2.11.0 (build #122)
    // Tested for SimpleLink SDK version: CC13x0 SDK 2.30.xx.xx
    // Device: CC1310 Rev. 2.1
    //
    //*********************************************************************************
    
    
    //*********************************************************************************
    // Parameter summary
    // Address: 0 
    // Address0: 0xAA 
    // Address1: 0xBB 
    // Frequency: 868.00000 MHz
    // Data Format: Serial mode disable 
    // Deviation: 25.000 kHz
    // pktLen: 30 
    // 802.15.4g Mode: 0 
    // Select bit order to transmit PSDU octets:: 1 
    // Packet Length Config: Variable 
    // Max Packet Length: 255 
    // Packet Length: 30 
    // Packet Data: 255 
    // 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_wb_dsss.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 = &rf_patch_rfe_wb_dsss,
        .rfePatchFxn = &rf_patch_rfe_genfsk,
    };
    
    // Overrides for CMD_PROP_RADIO_DIV_SETUP
    uint32_t pOverrides[] =
    {
        // override_use_patch_prop_genfsk.xml
        // PHY: Use MCE ROM bank 4, RFE RAM patch
        MCE_RFE_OVERRIDE(1,0,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_synth_disable_bias_div5.xml
            // Synth: Set divider bias to disabled
            HW32_ARRAY_OVERRIDE(0x405C,1),
            // Synth: Set divider bias to disabled (specific for loDivider=5)
            (uint32_t)0x18000200,
            // 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_wb_dsss_spreading_8.xml
            // Set correlation threshold to 0x48
            HW_REG_OVERRIDE(0x5108,0x0048),
            // Enable PA ramping of 5 us and AGC reference level of 0x1E
            HW_REG_OVERRIDE(0x6088,0x1F1E),
            // Set spreading = 8, K = 4
            HW_REG_OVERRIDE(0x52AC,0x0F33),
            // Tx: Configure PA ramping setting (0x08) for approximately 5 us PA ramp time
            HW_REG_OVERRIDE(0x608C,0x3F13),
            // TX: set intFreq = 0
            (uint32_t)0x00000343,
            // override_phy_rx_rssi_offset_5db.xml
            // Rx: Set RSSI offset to adjust reported RSSI by +5 dB (default: 0), trimmed for external bias and differential configuration
            (uint32_t)0x00FB88A3,
            (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 = 0x30C,
        .symbolRate.preScale = 0xF,
        .symbolRate.rateWord = 0x4CCCD,
        .symbolRate.decimMode = 0x0,
        .rxBw = 0x2C,
        .preamConf.nPreamBytes = 0x4,
        .preamConf.preamMode = 0x0,
        .formatConf.nSwBits = 0x20,
        .formatConf.bBitReversal = 0x0,
        .formatConf.bMsbFirst = 0x1,
        .formatConf.fecMode = 0x8,
        .formatConf.whitenMode = 0x1,
        .config.frontEndMode = 0x0,
        .config.biasMode = 0x1,
        .config.analogCfgMode = 0x0,
        .config.bNoFsPowerUp = 0x0,
        .txPower = 0xA63F,
        .pRegOverride = pOverrides,
        .centerFreq = 0x0399,
        .intFreq = 0x0B33,
        .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 = 0x0399,
        .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 = 0x1E, // SET APPLICATION PAYLOAD LENGTH
        .syncWord = 0x930B51DE,
        .pPkt = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    };
    

    Thank you,

    Greg

  • Hi Greg

    I am still not sure I understand exactly what you have problem with. Is it using LBT, is it getting the WB-DSSS settings to work, or is it the advance TX command.

    I have therefore modified the LBT example to use WD-DSSS settings (30 kbps, exported from SmartRF Studio), and I have replaced the CMD_PROP_TX with the CMD_PROP_TX_ADV. The packets format is kept the same, so that packets can be received by SmartRF Studio, with the only change that I am using the preTrigger to set the length of the preamble.

    My settings and modified rfPacketTX example is below:

    smartrf_settings.c:

    #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_wb_dsss.h)
    #include DeviceFamily_constructPath(rf_patches/rf_patch_rfe_wb_dsss.h)
    #include DeviceFamily_constructPath(rf_patches/rf_patch_mce_wb_dsss.h)
    #include "smartrf_settings.h"
    
    // TI-RTOS RF Mode Object
    RF_Mode RF_prop =
    {
        .rfMode = RF_MODE_PROPRIETARY_SUB_1,
        .cpePatchFxn = &rf_patch_cpe_wb_dsss,
        .mcePatchFxn = &rf_patch_mce_wb_dsss,
        .rfePatchFxn = &rf_patch_rfe_wb_dsss
    };
    
    // Overrides for CMD_PROP_RADIO_DIV_SETUP
    uint32_t pOverrides[] =
    {
        // override_use_patch_wb_dsss.xml
        // PHY: Use MCE RAM patch, RFE RAM patch
        MCE_RFE_OVERRIDE(1,0,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_synth_disable_bias_div5.xml
        // Synth: Set divider bias to disabled
        HW32_ARRAY_OVERRIDE(0x405C,1),
        // Synth: Set divider bias to disabled (specific for loDivider=5)
        (uint32_t)0x18000200,
        // 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_wb_dsss_spreading_8.xml
        // Set correlation threshold to 0x48
        HW_REG_OVERRIDE(0x5108,0x0048),
        // Enable PA ramping of 5 us and AGC reference level of 0x1E
        HW_REG_OVERRIDE(0x6088,0x1F1E),
        // Set spreading = 8, K = 4
        HW_REG_OVERRIDE(0x52AC,0x0F33),
        // Tx: Configure PA ramping setting (0x08) for approximately 5 us PA ramp time
        HW_REG_OVERRIDE(0x608C,0x3F13),
        // TX: set intFreq = 0
        (uint32_t)0x00000343,
        // override_phy_rx_rssi_offset_5db.xml
        // Rx: Set RSSI offset to adjust reported RSSI by +5 dB (default: 0), trimmed for external bias and differential configuration
        (uint32_t)0x00FB88A3,
        // TX power override
        // Tx: Set PA trim to max (in ADI0, set PACTL0=0xF8)
        ADI_REG_OVERRIDE(0,12,0xF8),
        (uint32_t)0xFFFFFFFF
    };
    
    // CMD_PROP_RADIO_DIV_SETUP
    // Proprietary Mode Radio Setup Command for All Frequency Bands
    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 = 0x30C,
        .symbolRate.preScale = 0xF,
        .symbolRate.rateWord = 0x4CCCD,
        .symbolRate.decimMode = 0x0,
        .rxBw = 0x2C,
        .preamConf.nPreamBytes = 0x5,
        .preamConf.preamMode = 0x1,
        .formatConf.nSwBits = 0x20,
        .formatConf.bBitReversal = 0x0,
        .formatConf.bMsbFirst = 0x0,
        .formatConf.fecMode = 0x8,
        .formatConf.whitenMode = 0x1,
        .config.frontEndMode = 0x0,
        .config.biasMode = 0x1,
        .config.analogCfgMode = 0x0,
        .config.bNoFsPowerUp = 0x0,
        .txPower = 0xA73F,
        .pRegOverride = pOverrides,
        .centerFreq = 0x0393,
        .intFreq = 0x0B33,
        .loDivider = 0x05
    };
    
    // 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 = 0x0393,
        .fractFreq = 0x0000,
        .synthConf.bTxMode = 0x0,
        .synthConf.refFreq = 0x0,
        .__dummy0 = 0x00,
        .__dummy1 = 0x00,
        .__dummy2 = 0x00,
        .__dummy3 = 0x0000
    };
    
    // 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 = 0x1,
        .pktConf.bCrcIncSw = 0x0,
        .pktConf.bCrcIncHdr = 0x1,
        .numHdrBits = 0x8,
        .pktLen = 0x0014,
        .startConf.bExtTxTrig = 0x0,
        .startConf.inputMode = 0x0,
        .startConf.source = 0x0,
        .preTrigger.triggerType = 0x0,
        .preTrigger.bEnaCmd = 0x0,
        .preTrigger.triggerNo = 0x0,
        .preTrigger.pastTrig = 0x0,
        .preTime = 0x00000000,
        .syncWord = 0x00000000,
        .pPkt = 0 // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    };

    rfPacketTX.c

    /***** Includes *****/
    /* Standard C Libraries */
    #include <stdlib.h>
    
    /* TI Drivers */
    #include <ti/drivers/rf/RF.h>
    #include <ti/drivers/PIN.h>
    #include <ti/drivers/pin/PINCC26XX.h>
    
    /* Board Header files */
    #include "Board.h"
    
    /* Application Header files */
    #include "smartrf_settings/smartrf_settings.h"
    #include "application_settings.h"
    
    /* Pin driver handle */
    static PIN_Handle ledPinHandle;
    static PIN_State ledPinState;
    
    /* Application LED pin configuration table: */
    PIN_Config ledPinTable[] =
    {
        Board_PIN_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
        IOID_1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,  // Debug signals
        IOID_21 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, // Debug signals
        PIN_TERMINATE
    };
    
    /***** Defines *****/
    #define PAYLOAD_LENGTH          30
    #define PACKET_INTERVAL_US      200000
    /* Number of times the CS command should run when the channel is BUSY */
    #define CS_RETRIES_WHEN_BUSY    10
    /* The channel is reported BUSY is the RSSI is above this threshold */
    #define RSSI_THRESHOLD_DBM      -80
    #define IDLE_TIME_US            5000
    /* Proprietary Radio Operation Status Codes Number: Operation ended normally */
    #define PROP_DONE_OK            0x3400
    
    /***** Prototypes *****/
    static void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e);
    
    /***** Variable declarations *****/
    static RF_Object rfObject;
    static RF_Handle rfHandle;
    
    static uint8_t packet[PAYLOAD_LENGTH + 1];
    static uint16_t seqNumber;
    
    static uint32_t time;
    
    /*
     *  ======== txTaskFunction ========
     */
    void *mainThread(void *arg0)
    {
        RF_Params rfParams;
        RF_Params_init(&rfParams);
    
        /* Open LED pins */
        ledPinHandle = PIN_open(&ledPinState, ledPinTable);
        if (ledPinHandle == NULL)
        {
            while(1);
        }
    
        // Debug signals to monitor RX and TX State
        PINCC26XX_setMux(ledPinHandle, IOID_1, PINCC26XX_MUX_RFC_GPO0);
        PINCC26XX_setMux(ledPinHandle, IOID_21, PINCC26XX_MUX_RFC_GPO1);
    
        /* Customize the CMD_PROP_TX_ADV command for this application */
        RF_cmdPropTxAdv.pktLen = PAYLOAD_LENGTH + 1;
        RF_cmdPropTxAdv.pPkt = packet;
        RF_cmdPropTxAdv.preTrigger.triggerType = TRIG_REL_START;
        RF_cmdPropTxAdv.preTime = (uint32_t)(4000000*(0.05f)); // 50 ms of preamble
    
        /* Set up the next pointers for the command chain */
        RF_cmdNop.pNextOp = (rfc_radioOp_t*)&RF_cmdPropCs;
        RF_cmdPropCs.pNextOp = (rfc_radioOp_t*)&RF_cmdCountBranch;
        RF_cmdCountBranch.pNextOp = (rfc_radioOp_t*)&RF_cmdPropTxAdv;
        RF_cmdCountBranch.pNextOpIfOk = (rfc_radioOp_t*)&RF_cmdPropCs;
    
        /* Customize the API commands with application specific defines */
        RF_cmdPropCs.rssiThr = RSSI_THRESHOLD_DBM;
        RF_cmdPropCs.csEndTime = (IDLE_TIME_US + 150) * 4; /* Add some margin */
        RF_cmdCountBranch.counter = CS_RETRIES_WHEN_BUSY;
        RF_cmdNop.startTrigger.triggerType = TRIG_ABSTIME;
        RF_cmdNop.startTrigger.pastTrig = 1;
    
        /* 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();
    
        /* Run forever */
        while(true)
        {
            packet[0] = PAYLOAD_LENGTH;
    
            /* Create packet with incrementing sequence number & random payload */
            packet[1] = (uint8_t)(seqNumber >> 8);
            packet[2] = (uint8_t)(seqNumber);
            uint8_t i;
            for (i = 3; i < PAYLOAD_LENGTH + 1; i++)
            {
                packet[i] = rand();
            }
    
            /* Set absolute TX time to utilize automatic power management */
            time += (PACKET_INTERVAL_US * 4);
            RF_cmdNop.startTime = time;
    
            /* Send packet */
            RF_runCmd(rfHandle, (RF_Op*)&RF_cmdNop, RF_PriorityNormal,
                      &callback, 0);
    
            RF_cmdNop.status = IDLE;
            RF_cmdPropCs.status = IDLE;
            RF_cmdCountBranch.status = IDLE;
            RF_cmdPropTxAdv.status = IDLE;
            RF_cmdCountBranch.counter = CS_RETRIES_WHEN_BUSY;
        }
    }
    
    /*
     *  ======== callback ========
     */
    void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
        if ((e & RF_EventLastCmdDone) && (RF_cmdPropTxAdv.status == PROP_DONE_OK))
        {
            seqNumber++;
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED1,
                               !PIN_getOutputValue(Board_PIN_LED1));
        }
    }
    

    BR

    Siri

  • Thank you very much Siri,

    It turns out that mixing the patches was my undoing when I updated the package to 3_20_00_23.

    During my previous version (3_10_00_11) the rf_patch_cpe_genfsk and rf_patch_cpe_wb_dsss were the same as each other, however in the later version they are different from each other.

    I believe that the differences were what was causing my problem.

    Thank you,

    Greg