Part Number:CC1310
Tool/software:TI-RTOS
Hello everyone,
Here's the code which compiles without any errors
#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 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;
/* 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 = 2; i < PAYLOAD_LENGTH; i++)
{
packet[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);
}
CONSOLE OUTPUT:
<Linking>
undefined first referenced
symbol in file
--------- ----------------
BoardGpioInitTable ./rfPacketTx.obj
PINCC26XX_hwAttrs C:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/tidrivers_cc13xx_cc26xx_2_21_00_04/packages/ti/drivers/lib/drivers_cc13xxware.aem3<PINCC26XX.oem3>
PowerCC26XX_config C:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/tidrivers_cc13xx_cc26xx_2_21_00_04/packages/ti/drivers/lib/drivers_cc13xxware.aem3<PowerCC26XX.oem3>
RFCC26XX_hwAttrs C:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/tidrivers_cc13xx_cc26xx_2_21_00_04/packages/ti/drivers/rf/lib/rf_singleMode_cc13xxware.aem3<RFCC26XX_singleMode.oem3>
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "rfPacketTx_CC1310DK_5XD_TI_CC1310F128.out" not built
>> Compilation failure
makefile:147: recipe for target 'rfPacketTx_CC1310DK_5XD_TI_CC1310F128.out' failed
makefile:143: recipe for target 'all' failed
gmake[1]: *** [rfPacketTx_CC1310DK_5XD_TI_CC1310F128.out] Error 1
gmake: *** [all] Error 2
Please find attachment of error window herewith
Please tell me where I am going wrong.
Thanks in advance for the help.