Tool/software: Code Composer Studio
I'm having some trouble including "PowerCC26XX.h" in "simpleBLEBroadcaster"
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.
Tool/software: Code Composer Studio
I'm having some trouble including "PowerCC26XX.h" in "simpleBLEBroadcaster"
Can you provide more details on when you get this error? Are you modifying a source file from within an example project, and if so, which project? Are you building in CCS Cloud?
Could you please provide more details on the exact steps you took that lead up to this error?
Hi,
According to the thread below, the BLE Stack version available in CCS Cloud is not the most up-to-date and it does not include the power drivers.
https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/p/547516/1998114
I imported the code to CCS7 desktop version and it has the same error. My ble sdk version is: ble_sdk_2_02_01_18
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
};
PIN_Config i2cPinTable[] = {
Board_I2C0_SDA0 | PIN_INPUT_EN | PIN_PULLUP | PIN_OPENDRAIN,
Board_I2C0_SCL0 | PIN_INPUT_EN | PIN_PULLUP | PIN_OPENDRAIN,
PIN_TERMINATE
};
void taskFxn(UArg a0, UArg a1) {
PRCMPowerDomainOn(PRCM_DOMAIN_PERIPH);
Power_setDependency(PowerCC26XX_PERIPH_I2C0);
// Set Power dependecies & constraints
Power_setDependency(PowerCC26XX_PERIPH_GPIO);
/* Set constraints for Standby, powerdown and idle mode */
Power_setConstraint(PowerCC26XX_SB_DISALLOW);
Power_setConstraint(PowerCC26XX_IDLE_PD_DISALLOW);
PRCMLoadSet();
PRCMPeripheralRunEnable(PRCM_PERIPH_I2C0); // Enable I2C module
PRCMPeripheralRunEnable(PRCM_PERIPH_GPIO);
PRCMLoadSet();
PINCC26XX_setMux(i2cPinHandle, Board_I2C0_SDA0, IOC_PORT_MCU_I2C_MSSDA);
PINCC26XX_setMux(i2cPinHandle, Board_I2C0_SCL0, IOC_PORT_MCU_I2C_MSSCL);
I2CSlaveInit(I2C0_BASE, 0x74);
uint32_t i2cDataArray[10];
uint8_t i;
i = 0;
while(1) {
while(I2CSlaveStatus(I2C0_BASE) != I2C_SLAVE_ACT_RREQ_FBR);
i2cDataArray[0] = I2CSlaveDataGet(I2C0_BASE);
PIN_setOutputValue(ledPinHandle, Board_LED0, 1);
{
for (i = 1; i < 10; i++)
{
while(I2CSlaveStatus(I2C0_BASE) != I2C_SLAVE_ACT_RREQ);
i2cDataArray[i] = I2CSlaveDataGet(I2C0_BASE);
PIN_setOutputValue(ledPinHandle, Board_LED0, !(PIN_getOutputValue(Board_LED0)));
}
}
PIN_setOutputValue(ledPinHandle, Board_LED0, 0);
}
}
/*
* ======== main ========
*/
int main(void)
{
Task_Params taskParams;
/* Call board init functions */
Board_initGeneral();
// Board_initI2C();
// Board_initSPI();
// Board_initUART();
// Board_initWatchdog();
/* Construct heartBeat Task thread */
Task_Params_init(&taskParams);
taskParams.arg0 = 1000000 / Clock_tickPeriod;
taskParams.stackSize = TASKSTACKSIZE;
taskParams.stack = &task0Stack;
Task_construct(&task0Struct, (Task_FuncPtr)taskFxn, &taskParams, NULL);
/* Open LED pins */
ledPinHandle = PIN_open(&ledPinState, ledPinTable);
if(!ledPinHandle) {
System_abort("Error initializing board LED pins\n");
}
i2cPinHandle = PIN_open(&i2cPinState, i2cPinTable);
if(!i2cPinHandle) {
System_abort("Error initializing board LED pins\n");
}
// PIN_setOutputValue(ledPinHandle, Board_LED0, 1);
/* Start BIOS */
BIOS_start();
return (0);
}
that includes "ti/drivers/power/PowerCC26XX.h" it works.
To be more precise, the code above works in CCS7 desktop version, but when included in a basic project (like pinInterrupt) but does not work when it's included in a larger project (like simplBLEBroadcaster).
Thank you!
If the source file has the line: #include <ti/drivers/power/PowerCC26XX.h>, then the compiler's include search path should include the directory to the tidrivers packages within TI-RTOS, specifically this directory: C:\ti\tirtos_cc13xx_cc26xx_2_20_01_08\products\tidrivers_cc13xx_cc26xx_2_20_01_10\packages.
In all the BLE and TI-RTOS example projects this directory is already added. It is specified under the XDCTools Package Repositories and at build time will get added to the file compiler.opt which then gets passed to the compiler when building C source files.
Could you check the following:
- the compiler.opt file in your project contains the above include path (fcompiler.opt can be found inside <build_config_directory/configPkg) and
- compiler.opt is being passed to the compiler build command (via the option --cmd_file="configPkg/compiler.opt" )