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.

Compiler/CC2650: CC2650 can't run to main( ), when i transplant program from CC13x0 to CC2650 in the simplelink_cc13x0_sdk_2_30_00_20 SDK

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

Tool/software: TI C/C++ Compiler

I want to use the demo code (simplelink_cc13x0_sdk_2_30_00_20/examples/rtos/CC1350STK/drivers/empty) run in CC2650.
I modify the IAR/options/General Options/DEVICE :TexasInstruments CC2650F128 ,
I modify the IAR/options/C/C+= COMpiler/Extra Options :"-DDeviceFamily_CC13X0 "to"-DDeviceFamily_CC26X0"
I move the "setup.h/chipinfo.h"form tirtos_cc13xx_cc26xx_2_21_01_08 to simplelink_cc13x0_sdk_2_30_00_20.

When i debug ,IAR can't run to main, it can't check the mcu is cc2650F128.
How can i modify the system parameter to recognize the chip for CC2650 ,let it run to main?

  • Hi xun,

    I am alerting Siri so that she can continue to support your efforts based on your previous thread: e2e.ti.com/.../759460

    Regards,
    Ryan
  • Hi Ryan
    Thanks , I'll wait for her reply on my previous thread.
  • HI,has Siri not had time to pay attention to my problems? I'm still waiting Online.I tried to modify some of the configuration about simplelink_cc13x0_sdk_2_30_00_20 SDK .Unluck ,I have failed, yet I shall try again.I hope you bring good news for me .
  • The following described the steps necessary to run the CC2650LP using the simplelink_cc13x0_sdk_2_30_00_20. I used the rfPacketTX example as a starting point:

    In addition, you need to copy the attached zip file to C:\ti\simplelink_cc13x0_sdk_2_30_00_20\source and extract to “ti\”.

    I have also attached the modified rfPacketTX.c and the settings files I used.

    1321.ti.zip

    //*********************************************************************************
    // Generated by SmartRF Studio version 2.12.0 (build #129 dev)
    // The applied template is NOT compatible with the selected device! There are no known SDK for this device.
    // Device: CC2650 Rev. 2.2
    //
    //*********************************************************************************
    
    
    //*********************************************************************************
    // Parameter summary
    // IEEE Channel: 11
    // Frequency: 2405 MHz
    // SFD: 0
    // Packet Data: 255 
    // Preamble      (32 bit): 01010101...
    // TX Power: 5 dBm
    
    #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_ieee_cmd.h)
    #include <ti/drivers/rf/RF.h>
    #include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_ieee.h)
    #include "smartrf_settings.h"
    
    
    // TI-RTOS RF Mode Object
    RF_Mode RF_ieee =
    {
        .rfMode = RF_MODE_IEEE_15_4,
        .cpePatchFxn = &rf_patch_cpe_ieee,
        .mcePatchFxn = 0,
        .rfePatchFxn = 0
    };
    
    
    // TX Power table
    // The RF_TxPowerTable_DEFAULT_PA_ENTRY and RF_TxPowerTable_HIGH_PA_ENTRY macro is defined in RF.h.
    // The following arguments are required:
    // RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
    // RF_TxPowerTable_HIGH_PA_ENTRY(bias, ibboost, boost, coefficient, ldoTrim)
    // See the Technical Reference Manual for further details about the "txPower" Command field.
    // The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
    RF_TxPowerTable_Entry txPowerTable[TX_POWER_TABLE_SIZE] =
    {
        {-21, RF_TxPowerTable_DEFAULT_PA_ENTRY(7, 3, 0, 6) },
        {-18, RF_TxPowerTable_DEFAULT_PA_ENTRY(9, 3, 0, 6) },
        {-15, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 6) },
        {-12, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 1, 0, 10) },
        {-9, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 1, 12) },
        {-6, RF_TxPowerTable_DEFAULT_PA_ENTRY(18, 1, 1, 14) },
        {-3, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 1, 1, 18) },
        {0, RF_TxPowerTable_DEFAULT_PA_ENTRY(33, 1, 1, 24) },
        {1, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 0, 0, 33) },
        {2, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 0, 0, 39) },
        {3, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 0, 0, 45) },
        {4, RF_TxPowerTable_DEFAULT_PA_ENTRY(36, 0, 1, 73) },
        {5, RF_TxPowerTable_DEFAULT_PA_ENTRY(48, 0, 1, 73) },
        RF_TxPowerTable_TERMINATION_ENTRY
    };
    
    
    // Overrides for CMD_RADIO_SETUP
    uint32_t pOverrides[] =
    {
        // override_synth_ieee_15_4.xml
        // Synth: Set recommended RTRIM to 5
        HW_REG_OVERRIDE(0x4038,0x0035),
        // Synth: Set Fref to 3.43 MHz
        (uint32_t)0x000784A3,
        // Synth: Set loop bandwidth after lock to 80 kHz
        (uint32_t)0xA47E0583,
        // Synth: Set loop bandwidth after lock to 80 kHz
        (uint32_t)0xEAE00603,
        // Synth: Set loop bandwidth after lock to 80 kHz
        (uint32_t)0x00010623,
        // Synth: Configure PLL bias
        HW32_ARRAY_OVERRIDE(0x405C,1),
        // Synth: Configure PLL bias
        (uint32_t)0x1801F800,
        // Synth: Configure PLL latency
        HW32_ARRAY_OVERRIDE(0x402C,1),
        // Synth: Configure PLL latency
        (uint32_t)0x00608402,
        // Synth: Use 24 MHz XOSC as synth clock, enable extra PLL filtering
        (uint32_t)0x02010403,
        // Synth: Configure extra PLL filtering
        HW32_ARRAY_OVERRIDE(0x4034,1),
        // Synth: Configure extra PLL filtering
        (uint32_t)0x177F0408,
        // Synth: Configure extra PLL filtering
        (uint32_t)0x38000463,
        // override_phy_ieee_15_4.xml
        // Synth: Increase synth programming timeout
        (uint32_t)0x05000243,
        // Rx: Adjust Rx FIFO threshold to avoid overflow
        (uint32_t)0x002082C3,
        // override_frontend_id.xml
        // Rx: Set RSSI offset to adjust reported RSSI by -2 dB
        (uint32_t)0x000288A3,
        // Rx: Configure LNA bias current trim offset
        (uint32_t)0x000F8883,
        // Rx: Adjust AGC DC filter
        HW_REG_OVERRIDE(0x50DC,0x002B),
        (uint32_t)0xFFFFFFFF
    };
    
    
    // CMD_RADIO_SETUP
    // Radio Setup Command for Pre-Defined Schemes
    rfc_CMD_RADIO_SETUP_t RF_cmdRadioSetup =
    {
        .commandNo = 0x0802,
        .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,
        .mode = 0x01,
        .__dummy0 = 0x00,
        .config.frontEndMode = 0x0,
        .config.biasMode = 0x0,
        .config.analogCfgMode = 0x0,
        .config.bNoFsPowerUp = 0x0,
        .txPower = 0x9330,
        .pRegOverride = pOverrides
    };
    
    
    // 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 = 0x0965,
        .fractFreq = 0x0000,
        .synthConf.bTxMode = 0x1,
        .synthConf.refFreq = 0x0,
        .__dummy0 = 0x00,
        .__dummy1 = 0x00,
        .__dummy2 = 0x00,
        .__dummy3 = 0x0000
    };
    
    
    // CMD_IEEE_TX
    // The command ID number 0x2C01
    rfc_CMD_IEEE_TX_t RF_cmdIeeeTx =
    {
        .commandNo = 0x2C01,
        .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,
        .txOpt.bIncludePhyHdr = 0x0,
        .txOpt.bIncludeCrc = 0x0,
        .txOpt.payloadLenMsb = 0x0,
        .payloadLen = 0x1E,
        .pPayload = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
        .timeStamp = 0x00000000
    };
    
    
    // CMD_IEEE_RX
    // The command ID number 0x2801
    rfc_CMD_IEEE_RX_t RF_cmdIeeeRx =
    {
        .commandNo = 0x2801,
        .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,
        .channel = 0x00,
        .rxConfig.bAutoFlushCrc = 0x0,
        .rxConfig.bAutoFlushIgn = 0x0,
        .rxConfig.bIncludePhyHdr = 0x0,
        .rxConfig.bIncludeCrc = 0x0,
        .rxConfig.bAppendRssi = 0x1,
        .rxConfig.bAppendCorrCrc = 0x1,
        .rxConfig.bAppendSrcInd = 0x0,
        .rxConfig.bAppendTimestamp = 0x0,
        .pRxQ = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx
        .pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
        .frameFiltOpt.frameFiltEn = 0x0,
        .frameFiltOpt.frameFiltStop = 0x0,
        .frameFiltOpt.autoAckEn = 0x0,
        .frameFiltOpt.slottedAckEn = 0x0,
        .frameFiltOpt.autoPendEn = 0x0,
        .frameFiltOpt.defaultPend = 0x0,
        .frameFiltOpt.bPendDataReqOnly = 0x0,
        .frameFiltOpt.bPanCoord = 0x0,
        .frameFiltOpt.maxFrameVersion = 0x3,
        .frameFiltOpt.fcfReservedMask = 0x0,
        .frameFiltOpt.modifyFtFilter = 0x0,
        .frameFiltOpt.bStrictLenFilter = 0x0,
        .frameTypes.bAcceptFt0Beacon = 0x1,
        .frameTypes.bAcceptFt1Data = 0x1,
        .frameTypes.bAcceptFt2Ack = 0x1,
        .frameTypes.bAcceptFt3MacCmd = 0x1,
        .frameTypes.bAcceptFt4Reserved = 0x1,
        .frameTypes.bAcceptFt5Reserved = 0x1,
        .frameTypes.bAcceptFt6Reserved = 0x1,
        .frameTypes.bAcceptFt7Reserved = 0x1,
        .ccaOpt.ccaEnEnergy = 0x0,
        .ccaOpt.ccaEnCorr = 0x0,
        .ccaOpt.ccaEnSync = 0x0,
        .ccaOpt.ccaCorrOp = 0x1,
        .ccaOpt.ccaSyncOp = 0x1,
        .ccaOpt.ccaCorrThr = 0x0,
        .ccaRssiThr = 0x64,
        .__dummy0 = 0x00,
        .numExtEntries = 0x00,
        .numShortEntries = 0x00,
        .pExtEntryList = 0, // INSERT APPLICABLE POINTER: (uint32_t*)&xxx
        .pShortEntryList = 0, // INSERT APPLICABLE POINTER: (uint32_t*)&xxx
        .localExtAddr = 0x0000000012345678,
        .localShortAddr = 0xABBA,
        .localPanID = 0x0000,
        .__dummy1 = 0x000000,
        .endTrigger.triggerType = 0x1,
        .endTrigger.bEnaCmd = 0x0,
        .endTrigger.triggerNo = 0x0,
        .endTrigger.pastTrig = 0x0,
        .endTime = 0x00000000
    };
    
    

    smartrf_settings.h

    /*
     * Copyright (c) 2017, 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 *****/
    /* Standard C Libraries */
    #include <stdlib.h>
    #include <unistd.h>
    
    /* TI Drivers */
    #include <ti/drivers/rf/RF.h>
    #include <ti/drivers/PIN.h>
    #include <ti/drivers/pin/PINCC26XX.h>
    
    /* Driverlib Header files */
    //#include DeviceFamily_constructPath(driverlib/rf_prop_mailbox.h)
    
    /* Board Header files */
    #include "Board.h"
    #include "smartrf_settings/smartrf_settings.h"
    
    /***** Defines *****/
    
    /* Do power measurement */
    
    /* Packet TX Configuration */
    #define PAYLOAD_LENGTH      30
    
    #define PACKET_INTERVAL     500000  /* Set packet interval to 500000us or 500ms */
    
    
    /***** Prototypes *****/
    
    /***** 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;
    
    /*
     * 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,
        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);
        }
    
    
        RF_cmdIeeeTx.payloadLen = PAYLOAD_LENGTH;
        RF_cmdIeeeTx.pPayload = packet;
        RF_cmdIeeeTx.startTrigger.triggerType = TRIG_NOW;
    
        /* Request access to the radio */
        rfHandle = RF_open(&rfObject, &RF_ieee, (RF_RadioSetup*)&RF_cmdRadioSetup, &rfParams);
    
        /* Set the frequency */
        RF_runCmd(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);
            packet[1] = (uint8_t)(seqNumber++);
            uint8_t i;
            for (i = 2; i < PAYLOAD_LENGTH; i++)
            {
                packet[i] = rand();
            }
    
            RF_ScheduleCmdParams scheduleParam;
            RF_ScheduleCmdParams_init(&scheduleParam);
    
            RF_CmdHandle txCmd = RF_runScheduleCmd(rfHandle, (RF_Op*)&RF_cmdIeeeTx, &scheduleParam, NULL, RF_EventLastFGCmdDone);
    
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED1,!PIN_getOutputValue(Board_PIN_LED1));
    
            /* Power down the radio */
            RF_yield(rfHandle);
    
            /* Sleep for PACKET_INTERVAL us */
            usleep(PACKET_INTERVAL);
        }
    }
    

    Please note that I have not done any changes to the board files. This might be necessary if running other examples/using other peripherals than what is done in the rfPacketTx example.

    BR

    Siri

  • OK,I'll test it right away.
  • Hi Siri
    Can you give me a example about switch rx to tx in IEEE mode?
    In above code, why you use RF_runScheduleCmd? what is different between RF_runScheduleCmd and RF_runCmd?
  • Hi Siri,

    Can you give me some advice about the follow code.

    /***** 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>
    
    /* Driverlib Header files */
    #include DeviceFamily_constructPath(driverlib/rf_prop_mailbox.h)
    
    /* Board Header files */
    #include "Board.h"
    
    /* Application Header files */
    #include "RFQueue.h"
    #include "smartrf_settings/smartrf_settings.h"
    
    /***** Defines *****/
    /* Packet TX/RX Configuration */
    #define PAYLOAD_LENGTH      30
    /* Set packet interval to 1000ms */
    #define PACKET_INTERVAL     (uint32_t)(4000000*1.0f)
    /* Set Receive timeout to 500ms */
    #define RX_TIMEOUT          (uint32_t)(4000000*0.5f)
    /* NOTE: Only two data entries supported at the moment */
    #define NUM_DATA_ENTRIES    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) */
    #define NUM_APPENDED_BYTES  2
    
    /* Log radio events in the callback */
    //#define LOG_RADIO_EVENTS
    
    /***** Prototypes *****/
    //static void echoCallback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e);
    static void txCallback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e);
    static void rxCallback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e);
    static void transmit();
    static void receive();
    
    /***** Variable declarations *****/
    static RF_Object rfObject;
    static RF_Handle rfHandle;
    
    /* Pin driver handle */
    static PIN_Handle ledPinHandle;
    static PIN_State ledPinState;
    
    /* Buffer which contains all Data Entries for receiving data.
     * Pragmas are needed to make sure this buffer is aligned to a 4 byte boundary
     * (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,
                                                      PAYLOAD_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,
                                                      PAYLOAD_LENGTH,
                                                      NUM_APPENDED_BYTES)];
    #elif defined(__GNUC__)
    static uint8_t
    rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(NUM_DATA_ENTRIES,
                                                      PAYLOAD_LENGTH,
                                                      NUM_APPENDED_BYTES)]
                                                      __attribute__((aligned(4)));
    #else
    #error This compiler is not supported
    #endif //defined(__TI_COMPILER_VERSION__)
    
    /* Receive Statistics */
    static rfc_propRxOutput_t rxStatistics;
    
    /* 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 uint8_t txPacket[PAYLOAD_LENGTH];
    static uint8_t rxPacket[PAYLOAD_LENGTH + NUM_APPENDED_BYTES - 1];
    static uint16_t seqNumber;
    static uint16_t snumber = 0;
    int nReceived = 0;
    static uint32_t curtime;
    
    static volatile bool bRxSuccess = false;
    
    #ifdef LOG_RADIO_EVENTS
    static volatile RF_EventMask eventLog[32];
    static volatile uint8_t evIndex = 0;
    #endif // LOG_RADIO_EVENTS
    
    /*
     * 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,
     Board_PIN_LED2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
     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);
        }
    
        if(RFQueue_defineQueue(&dataQueue,
                               rxDataEntryBuffer,
                               sizeof(rxDataEntryBuffer),
                               NUM_DATA_ENTRIES,
                               PAYLOAD_LENGTH + NUM_APPENDED_BYTES))
        {
            /* Failed to allocate space for all data entries */
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED1, 1);
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED2, 1);
            while(1);
        }
        
        /* Modify CMD_PROP_TX and CMD_PROP_RX commands for application needs */
    //    RF_cmdPropTx.pktLen = PAYLOAD_LENGTH;
    //    RF_cmdPropTx.pPkt = txPacket;
    //    RF_cmdPropTx.startTrigger.triggerType = TRIG_ABSTIME;
    //    RF_cmdPropTx.startTrigger.pastTrig = 1;
    //    RF_cmdPropTx.startTime = 0;
        RF_cmdIeeeTx.payloadLen = PAYLOAD_LENGTH;
        RF_cmdIeeeTx.pPayload = txPacket;
        RF_cmdIeeeTx.startTrigger.triggerType = TRIG_ABSTIME;
        RF_cmdIeeeTx.startTrigger.pastTrig = 1;
        RF_cmdIeeeTx.startTime = 0;
        
        
        /* Set the Data Entity queue for received data */
        RF_cmdIeeeRx.pRxQ = &dataQueue;
        /* Discard ignored packets from Rx queue */
        RF_cmdIeeeRx.rxConfig.bAutoFlushIgn = 1;
        /* Discard packets with CRC error from Rx queue */
        RF_cmdIeeeRx.rxConfig.bAutoFlushCrc = 1;
    
        RF_cmdIeeeRx.rxConfig.bIncludePhyHdr = 1;
        RF_cmdIeeeRx.rxConfig.bIncludeCrc = 1;
        RF_cmdIeeeRx.rxConfig.bAppendRssi = 1;
        RF_cmdIeeeRx.rxConfig.bAppendCorrCrc = 1;
        RF_cmdIeeeRx.rxConfig.bAppendSrcInd = 0;
        RF_cmdIeeeRx.rxConfig.bAppendTimestamp = 1;
        RF_cmdIeeeRx.pOutput = (rfc_ieeeRxOutput_t *)&rxStatistics;
        /* Receive operation will end RX_TIMEOUT ms after command starts */
        //RF_cmdIeeeRx.endTrigger.triggerType = TRIG_REL_PREVEND;
        //RF_cmdIeeeRx.endTime = RX_TIMEOUT;
    
        /* Request access to the radio */
    //    rfHandle = RF_open(&rfObject, &RF_prop,
    //                       (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
        
            /* Request access to the radio */
        rfHandle = RF_open(&rfObject, &RF_ieee, (RF_RadioSetup*)&RF_cmdRadioSetup, &rfParams);
    
    //    /* Set the frequency */
    //    RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
        /* Set the frequency */
        RF_runCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
        
        /* Get current time */
        curtime = RF_getCurrentTime();
        
        while(1)
        {
            transmit();
            receive();
        }
    }
    
    static void txCallback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
        if(e & RF_EventCmdDone)
        {
            /* Successful TX */
            /* Toggle LED1, clear LED2 to indicate TX */
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED1,
                !PIN_getOutputValue(Board_PIN_LED1));
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED2, 0);
        }
        else
        {
            /* Error Condition: set both LEDs */
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED1, 1);
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED2, 1);
        }
        //printf("Packet sent!\n");
    }
    
    static void rxCallback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
    #ifdef LOG_RADIO_EVENTS
        eventLog[evIndex++ & 0x1F] = e;
    #endif// LOG_RADIO_EVENTS
        //printf("rxCallback!\n");
        if (e & RF_EventRxEntryDone)
        {
            /* Successful RX */
            bRxSuccess = true;
            //printf("packet received\n");
    
            /* 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 + status byte to the rxPacket variable */
            memcpy(rxPacket, packetDataPointer, (packetLength + 1));
            /* Toggle LED1, clear LED2 to indicate RX */
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED1, !PIN_getOutputValue(Board_PIN_LED1));
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED2, 0);
            nReceived++;
            RFQueue_nextEntry();
        }
        else if (!(e & RF_EventRxEntryDone))
        {
            if (bRxSuccess == true)
            {
                //printf("scomplete\n");
                /* Received packet successfully but RX command didn't complete at
                 * the same time RX_ENTRY_DONE event was raised. Reset the flag
                 */
                bRxSuccess = false;
            }
            else
            {
                /* RX timed out */
                /* Set LED2, clear LED1 to indicate TX */
                //printf("timeout!\n");
                PIN_setOutputValue(ledPinHandle, Board_PIN_LED1, 0);
                PIN_setOutputValue(ledPinHandle, Board_PIN_LED2, 1);
            }
        }
        else
        {
            //printf("error!\n");
            /* Error Condition: set both LEDs */
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED1, 1);
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED2, 1);
        }
    }
    void transmit()
    {
        int n;
        for (n = 0; n < 10; n++)
        {
            /* Create packet with incrementing sequence number and random payload */
            txPacket[0] = (uint8_t)(seqNumber >> 8);
            txPacket[1] = (uint8_t)(seqNumber++);
            uint8_t i;
            for (i = 2; i < PAYLOAD_LENGTH; i++)
            {
                txPacket[i] = snumber;
                //txPacket[i] = rand();
            }
            snumber++;
    
            /* Set absolute TX time to utilize automatic power management */
            //curtime += PACKET_INTERVAL;
            //RF_cmdPropTx.startTime = curtime;
            //RF_EventMask terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, txCallback, RF_EventCmdDone);
    
            RF_ScheduleCmdParams scheduleParam;
            RF_ScheduleCmdParams_init(&scheduleParam);
            
            scheduleParam.priority = RF_PriorityNormal;
            scheduleParam.endTime = 0;
    
            RF_CmdHandle txCmd = RF_runScheduleCmd(rfHandle, (RF_Op*)&RF_cmdIeeeTx, &scheduleParam, txCallback, RF_EventCmdDone|RF_EventLastFGCmdDone);
    
        }
    }
    
    void receive()
    {
        nReceived = 0;
        while (nReceived <= 10)
        {
            //printf("loop!\n");
            //RF_EventMask terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, rxCallback, RF_EventRxEntryDone);
            
            RF_ScheduleCmdParams scheduleParam;
            RF_ScheduleCmdParams_init(&scheduleParam);
            scheduleParam.priority = RF_PriorityNormal;
            scheduleParam.endTime = 0;        
            
            RF_CmdHandle rxCmd = RF_runScheduleCmd(rfHandle, (RF_Op*)&RF_cmdIeeeRx, &scheduleParam, rxCallback, RF_EventRxEntryDone);
        }
    }

    Is there any error in this code?

    Thank you!

  • ocnp, Please post this as a new thread instead of posting your question in an old thread that is not related to your questions in any way.
    The original thread was about running CC2650 using the CC13x0 SDK, and what changes was necessary to get this to work.

    When you post a new thread with your questions, please provide information about what SDK/TI-RTOs release you are using.

    BR

    Siri
  • HI,Siri. i'm back,i'll continue to explore this application. It still has problems, I am still analyzing the problem.

    I used IRA to debug CC26X0 in the past . So I spent one day familiar with the CCS Development Environment.
    I want to say the new CCS V8 is batter than old Version,i used the CCS3 a few years ago .

    The environment I use is:  CCS Development Environment: Code Composer Studio Version: 8.3.0.00009 

                                             SDK: simplelink_cc13x0_sdk_2_30_00_20

    I use the tirtos_cc13xx_cc26xx_2_21_00_06/rfPacketTx_CC2650DK_7ID_TI test this Development Environment.
    The Development Environment system works is ok.The cc2650 mcu control LED work is ok.

    I strictly follow your instructions to modify the configuration and related files.
    The first problem is about the third picture you provided .


    Do we need repair ${COM_TI_SIMPLELINK_CC13X0_SDK_INSTALL_DIR}/kernel/tirtos/packages/ti/dpl/lib/dpl_cc13x0.aem3 to
    ${COM_TI_SIMPLELINK_CC13X0_SDK_INSTALL_DIR}/kernel/tirtos/packages/ti/dpl/lib/dpl_cc26x0.aem3 ?

    This point i'm not sure.
    I test repair it to dpl_cc26x0.aem3 ,i have'n discover any difference. So i follow your instruction keep on use dpl_cc13x0.aem3.

    The new problem is When i debug ,CCS can't run to main too. It's dead again.

    The code run to ti_sysbios_rom_cortexm_cc13xx_CC13xx_checkRevision__E()……Why?I can't understand.

    This phenomenon is  similar to the earliest phenomena.

    And i test it with two different computers ,i get the same phenomenon .

    I worry about that :your simplelink_academy_cc13x0sdk_2_20_03_05  have some special setting .So you can success ,and I failed. 

    I suggest you confirm on the new CCS and simplelink_cc13x0_sdk_2_30_00_20 SDK system .

    Looking forward to your new instructions. Now,I'm trying to modify other parameters. 

    My ultimate goal is run ieeeRx and  ieeeTx  in the CC2630(5*5),  i think there's a lot of work to do, good luck for me. 

  • Hi

    I run through all the steps again and realized that I had done several mistakes in my explanation to you. I am sorry about that. I have now corrected the old post, with the following:
    Correct SDK version
    I have changed the screenshot with the File Search Paths
    I have added a screenshot showing changes that must be done in release.cfg

    Hopefully this will you get it up and running.

    BR

    Siri
  • Thanks, i'll test again.
  • You can use my attachment
    e2e.ti.com/.../rfPacketTx.rar
    In IAR 8.32.1
  • Hi,
    I've been testing it for three days.
    I report the status of CC2650 7X7 using the CC13x0 SDK simplelink_cc13x0_sdk_2_30_00_20.
    CCS Development Environment: Code Composer Studio Version: 8.3.0.00009
    SDK: simplelink_cc13x0_sdk_2_30_00_20

    In this SDK,The CCS8 Program compilation speed is faster than IAR8.3.
    1. Test experiment of IO about control LED and BUTTON; test result: OK.
    2. Test experiment of IEEE Radio TX data and IEEE Radio RX data in one program ; test result: OK.
    (
    PS:During the test Radio, it would be a failure to run Radio RX before the TX.
    I haven't had enough time to find out why,i think it's my mistake about code .
    Now i using IEEE Radio TX before the RX. It's OK.
    )
    So i'm sure this development environment can be run success in the cc2650F128(7X7).

    @SIri Thank you for your technical support..

    Beacuse of My ultimate goal is running CC2630(5*5) using this SDK,
    SO i want to keep this thread until finished this function.
    It can be used as a reference for other electronic engineers.

    OK,I'm going to start the modify program from CC2650(7X7) to CC2630(5x5).
    I've been successful modify program on the tirtos_cc13xx_cc26xx_2_21_01_08 before.
    I worry about the heard file of simplelink_cc13x0_sdk_2_30_00_20 can't support CC2630/CC2650(5x5) harware.
    Please wait for my feedback.

  • I will mark this post as solved, and then you can re-open it refer to this case when/if you have follow-up questions.

    BR

    Siri
  • HI,

    I agree with you. 

    I have tested the cc2630(5X5) run in this SDK,It's OK.

    First it need repair CC1310_LAUNCHXL.h and board.h……,then it  need repair the key of settings as described below:

    @Siri Thank you again .