Other Parts Discussed in Thread: CC2630, TIMAC
Where can I find the PER Test program for the CC2650?
In the TI rtos, I find a per test program for cc2650, but 802.15.4 mode does not given.
Where can I find it?
Thank you!
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.
Hi,
I used a simple example to test IEEE 802.15.4 mode, when I send message using RF_runCmd, but the program stops at "
RF_runCmd(rfHandle, (RF_Op*)&RF_cmdIeeeTx, RF_PriorityNormal, NULL, 0);
"
Here is my code.
/*
* ======== pwmled.c ========
*/
/* XDCtools Header files */
#include <xdc/std.h>
#include <xdc/runtime/System.h>
/* BIOS Header files */
#include <ti/sysbios/BIOS.h>
#include <xdc/runtime/Types.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/knl/Event.h>
#include <ti/sysbios/knl/Clock.h>
#include <driverlib/prcm.h>
/* TI-RTOS Header files */
#include <ti/drivers/PIN.h>
/***** Includes *****/
/* XDCtools Header files */
#include <xdc/runtime/Assert.h>
/* TI-RTOS Header files */
#include <ti/drivers/rf/RF.h>
/* Board Header files */
#include "Board.h"
#include "smartrf_settings.h"
#include <ti/drivers/pin/PINCC26XX.h>
#include <ti/drivers/timer/GPTimerCC26XX.h>
#include <ti/drivers/Power.h>
#include <ti/drivers/power/PowerCC26XX.h>
#define PAYLOAD_LENGTH 30 /* Length of the packet to send */
static uint8_t packet[PAYLOAD_LENGTH];
//
/* Example/Board Header files */
#include "Board.h"
GPTimerCC26XX_Handle hTimer0, hTimer1;
PIN_State gpTimerPinState;
PIN_Handle gpTimerPinHandle;
/***** Variable declarations *****/
static RF_Object rfObject;
static RF_Handle rfHandle;
RF_ScheduleCmdParams schParams;
/*
* Application LED pin configuration table:
* - All LEDs board LEDs are off.
*/
PIN_Config ledPinTable[] = {
Board_LED0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
Board_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
PIN_TERMINATE
};
/*
* ======== main ========
*/
int main()
{
PIN_init(BoardGpioInitTable);
gpTimerPinHandle = PIN_open(&gpTimerPinState, ledPinTable);
if (!gpTimerPinHandle)
{
System_abort("Error initializing board led pins\n");
}
RF_Params rfParams;
RF_Params_init(&rfParams);
rfParams.nInactivityTimeout = 500; // 500us
// Configure RF schedule command parameters
schParams.priority = RF_PriorityNormal;
schParams.endTime = 0;
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_prop, (RF_RadioSetup*)&RF_cmdRadioSetup, &rfParams);
while(1)
{
/* Create packet with random payload */
uint8_t i;
for (i = 0; i < PAYLOAD_LENGTH; i++)
{
packet[i] = 0x55;
}
RF_cmdFs.frequency = 0x0965; // channel 11
RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
RF_EventMask result = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdIeeeTx, RF_PriorityNormal, NULL, 0);
//RF_cmdFs.frequency = 0x0983; // channel 17
//RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
//result = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdIeeeTx, RF_PriorityNormal, NULL, 0);
// Schedule a proprietary TX command
//RF_scheduleCmd(rfHandle, (RF_Op*)&RF_cmdIeeeTx, &schParams, NULL, RF_EventLastCmdDone);
PIN_setOutputValue(gpTimerPinHandle, Board_LED1,!PIN_getOutputValue(Board_LED1));
}
// Hwi_Params hp;
// Hwi_Params_init(&hp);
// //Interrupts Enable by default
// hp.enableInt = TRUE;
//
// /* Construct hardware interrupt for timerCall back event */
// Hwi_construct(&timerCallbackInt, INT_GPT0A, timerCallback, &hp, NULL);
// Hwi_setPriority(INT_GPT0A, 0);
/* enable interrupts and start SYS/BIOS */
}
-------------------------------------
//*********************************************************************************
// Generated by SmartRF Studio version 2.11.0 (build#126)
// The applied template is compatible with tirtos_simplelink_2_21_00
// 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 <driverlib/rf_mailbox.h>
#include <driverlib/rf_common_cmd.h>
#include <driverlib/rf_ieee_cmd.h>
#include <ti/drivers/rf/RF.h>
#include <rf_patches/rf_patch_cpe_ieee.h>
#include "smartrf_settings.h"
// TI-RTOS RF Mode Object
RF_Mode RF_prop =
{
.rfMode = RF_MODE_IEEE_15_4,
.cpePatchFxn = &rf_patch_cpe_ieee,
.mcePatchFxn = 0,
.rfePatchFxn = 0,
};
// 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
};
I use tirtos_cc13xx_cc26xx_2_21_01_08 , IAR and CC2650 chip.
I can send packets using RF Packet Error Rate Test example in tirtos_cc13xx_cc26xx_2_21_01_08.
But I can not send out the IEEE packet using tirtos_cc13xx_cc26xx_2_21_01_08.
Can you give me some help?
why I can not TX ok?
@Siri