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.

How do you create a custom BLE stack application?

Other Parts Discussed in Thread: CC2640

Hi,

I've managed to compile and examine a few examples in the BLE stack. Now I'd like to create a custom project that I can run on the CC2640 that is on my own PCB. I've got the latest version of CCS, TI-RTOS 2.18 and BLE stack 2.2 installed.

Initially I believed I could just start with one of the example projects and just edit that, but then I discovered that the files in the example are linked, so I can't put them in source control and I also can't edit them without also editing the original file. I tried deleting the links and copying the files to the actual project location, but then it didn't compile. So I gave up on that.

Now I'd just like to create a custom project that works. Here's what I did so far:

  1. Created an empty RTSC project
  2. Created an RTSC configuration file and used the GUI to edit it to match the one in the BLE simple peripheral example
  3. Added driverlib to the include paths in project properties
  4. Created a main.c file
  5. Attempted to compile

Here is my main.c

#include <xdc/runtime/Error.h>
#include <ti/drivers/Power.h>
#include <ti/drivers/power/PowerCC26XX.h>
#include <ti/sysbios/BIOS.h>

int main()
{
    /* enable interrupts and start SYS/BIOS */
    BIOS_start();

    return 0;
}


Now I get this in the console:

**** Build of configuration Debug for project fcble ****

/home/Timur/dev/ti/ccsv6/utils/bin/gmake -k all 
Building file: ../fcble.cfg
Invoking: XDCtools
"/home/Timur/dev/ti/xdctools_3_32_00_06_core/xs" --xdcpath="/home/Timur/dev/ti/tirtos_cc13xx_cc26xx_2_18_00_03/packages;/home/Timur/dev/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/tidrivers_cc13xx_cc26xx_2_16_01_13/packages;/home/Timur/dev/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/bios_6_45_02_31/packages;/home/Timur/dev/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/uia_2_00_05_50/packages;/home/Timur/dev/ti/ccsv6/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.M3 -p ti.platforms.simplelink:CC2640F128 -r debug -c "/home/Timur/dev/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.7" "../fcble.cfg"
making package.mak (because of package.bld) ...
generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
configuring fcble.xem3 from package/cfg/fcble_pem3.cfg ...
generating custom ti.sysbios library makefile ... 
Starting build of library sources ...
making /home/Timur/Projects/misc/ti_workspace/fcble/src/sysbios/sysbios.aem3 ...
gmake[1]: Entering directory `/home/Timur/Projects/misc/ti_workspace/fcble/src/sysbios'
clem3 /home/Timur/dev/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/bios_6_45_02_31/packages/ti/sysbios/BIOS.c ...

>> Compilation failure
gmake[1]: Leaving directory `/home/Timur/Projects/misc/ti_workspace/fcble/src/sysbios'
Build of libraries failed.
subdir_rules.mk:7: recipe for target 'configPkg/linker.cmd' failed
"/home/Timur/dev/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/bios_6_45_02_31/packages/ti/sysbios/family/arm/cc26xx/Boot.c", line 36: fatal error: cannot open source file "driverlib/sys_ctrl.h"
1 catastrophic error detected in the compilation of "/home/Timur/dev/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/bios_6_45_02_31/packages/ti/sysbios/family/arm/cc26xx/Boot.c".
Compilation terminated.
gmake[1]: *** [BIOS.obj] Error 1
gmake: *** [/home/Timur/Projects/misc/ti_workspace/fcble/src/sysbios/sysbios.aem3] Error 2
error: xdc.cfg.SourceDir: "/home/Timur/dev/ti/xdctools_3_32_00_06_core/packages/xdc/cfg/SourceDir.xs", line 209: xdc.cfg.SourceDir : Build of generated source libraries failed: exit status = 2:

js: "/home/Timur/dev/ti/xdctools_3_32_00_06_core/packages/xdc/cfg/Main.xs", line 160: Error: Configuration failed!
gmake: *** [package/cfg/fcble_pem3.xdl] Error 1
gmake: *** Deleting file `package/cfg/fcble_pem3.xdl'
gmake: *** [package/cfg/fcble_pem3.xdl] Deleting file `package/cfg/fcble_pem3.h'
gmake: *** [package/cfg/fcble_pem3.xdl] Deleting file `package/cfg/fcble_pem3.c'
js: "/home/Timur/dev/ti/xdctools_3_32_00_06_core/packages/xdc/tools/Cmdr.xs", line 51: Error: xdc.tools.configuro: configuration failed due to earlier errors (status = 2); 'linker.cmd' deleted.
gmake: *** [configPkg/linker.cmd] Error 1
gmake: Target 'all' not remade because of errors.

**** Build Finished ****

Looks like the error is that it doesn't find the driverlib, even though I added it to the project's include paths...

Can you guys please point me in the right direction? What am I doing wrong here?