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.

CCS/CC2640: How do I copy a SDK example project AND example source files

Part Number: CC2640
Other Parts Discussed in Thread: CC2650

Tool/software: Code Composer Studio

I want to start modifying the simple_peripheral_cc2650em_app project.  However, the source files are actually in the SDK directory so if I change them I am modifying the SDK.  What if I want to make copies and modify those, preserving the original project source files files?

  • Hi Mark,

    We recommend putting your SDK installation under version control, such as Git, so you don't have to worry about modifying SDK files.
  • Hi,

    We have exactly the same problem; for our software development processes, we need to have the project code away from the C:\ti installation directory. Adding the entire SDK directory into version control isn't an option (for internal reasons).

    I have copied the simple peripheral project to D:\. I have changed the custom argument variables to point to the correct C:\ti...SDK directory.
    When I rebuild the project, I get the following output from the pre-build stage:

    Building configuration: cc2640r2lp_app - FlashROM_StackLibrary_RCOSC
    Updating build tree...

    0 file(s) deleted.
    Updating build tree...
    Performing Pre-Build Action
    Error while running "c:/ti/xdctools_3_50_03_33_core\xs" --xdcpath="c:/ti/simplelink_cc2640r2_sdk_1_50_00_58/kernel/tirtos/packages;c:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source" iar.tools.configuro -c "C:\Program Files (x86)\IAR
    Systems\Embedded Workbench 8.0\arm" --cc "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\arm\bin\iccarm.exe" --device "CC2640R2F" --compileOptions "dummy.c -D BOARD_DISPLAY_USE_LCD=0 -D
    BOARD_DISPLAY_USE_UART=1 -D BOARD_DISPLAY_USE_UART_ANSI=1 -D CC2640R2_LAUNCHXL -D CC26XX -D CC26XX_R2 -D DeviceFamily_CC26X0R2 -D xDisplay_DISABLE_ALL -D ICALL_EVENTS -D ICALL_JT -D
    ICALL_LITE -D ICALL_MAX_NUM_ENTITIES=6 -D ICALL_MAX_NUM_TASKS=3 -D ICALL_STACK0_ADDR -D MAX_NUM_BLE_CONNS=1 -D POWER_SAVING -D RF_SINGLEMODE -D STACK_LIBRARY -D USE_ICALL -D
    USE_RCOSC -D xdc_runtime_Assert_DISABLE_ALL -D xdc_runtime_Log_DISABLE_ALL --diag_suppress Pa050 -o D:\simple_peripheral\tirtos\iar\app\FlashROM_StackLibrary_RCOSC\Obj --debug --endian=little --cpu=Cortex-M3 -f C:\ti\
    simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\config\build_components.opt -f C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\config\factory_config.opt -f D:\simple_peripheral\tirtos\iar\app\..\..\..\tirtos\
    build_config.opt -f D:\simple_peripheral\tirtos\iar\app\..\config\configPkg\compiler.opt.defs -e --fpu=None --dlib_config \"C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\arm\INC\c\DLib_Config_Normal.h\" -I C:\ti\
    simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\controller\cc26xx_r2\inc\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\inc\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\common\cc26xx\ -I
    C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\common\cc26xx\rcosc\ -I D:\simple_peripheral\tirtos\iar\app\..\..\..\src\app\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\icall\inc\ -I C:\ti\
    simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\inc\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\dev_info\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\roles\ -I C:\ti\
    simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\roles\cc26xx\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\simple_profile\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\
    profiles\simple_profile\cc26xx\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\target\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\hal\src\inc\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\
    blestack\hal\src\target\_common\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\hal\src\target\_common\cc26xx\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\heapmgr\ -I C:\ti\
    simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\icall\src\inc\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\osal\src\inc\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\services\src\saddr\ -I C:\
    ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\services\src\sdata\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\devices\cc26x0r2\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ -Ohz" --linkOptions "-o D:\
    simple_peripheral\tirtos\iar\app\FlashROM_StackLibrary_RCOSC\Exe\ble_simple_peripheral_cc2640r2lp_app_FlashROM_StackLibrary_RCOSC.out --config_def CC2650=2 --config_def FLASH_ROM_BUILD=2 --map D:\
    simple_peripheral\tirtos\iar\app\FlashROM_StackLibrary_RCOSC\List\ble_simple_peripheral_cc2640r2lp_app_FlashROM_StackLibrary_RCOSC.map --config C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\common\
    cc26xx\iar\cc26xx_app_and_stack.icf --keep __vector_table -f D:\simple_peripheral\tirtos\iar\app\..\config\configPkg\linker.cmd -f D:\simple_peripheral\tirtos\iar\app\..\config\lib_linker.cmd D:\simple_peripheral\tirtos\iar\app\..\config\
    ble_r2.symbols C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\devices\cc26x0r2\driverlib\bin\iar\driverlib.lib C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\kernel\tirtos\packages\ti\dpl\lib\dpl_cc26x0r2.arm3 C:\ti\
    simplelink_cc2640r2_sdk_1_50_00_58\source\ti\drivers\lib\drivers_cc26x0r2.arm3 C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\drivers\rf\lib\rf_singleMode_cc26x0r2.arm3 C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\
    display\lib\display.arm3 C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\grlib\lib\grlib.arm3 C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\mw\lcd\lib\lcd.arm3 --entry __iar_program_start --vfe --text_out locale" --profile release
    --projFile "D:\simple_peripheral\tirtos\iar\app\cc2640r2lp_app.ewp" --cfgArgs NO_ROM=0 -o D:\simple_peripheral\tirtos\iar\app\..\config\configPkg D:\simple_peripheral\tirtos\iar\app\..\..\..\tirtos\app_ble.cfg

    Total number of errors: 1 

    Total number of warnings: 0

    The stack sub-project builds fine.

    Can you point me to which bit is failing as all the paths seem to point to the right places?

    Many thanks,
    Richard

    (Note to all: please no responses regarding putting things under version control. It must be possible to successfully locate projects outside of the SDK directories, we just need a clear answer how. Thank you.)

  • Hi Richard,

    The "Version Control" answer is just a lazy one.  I think the real problem is too many cooks in the kitchen and when things no longer work its easier to give this answer then try to fix the problem.

    It looks like you are using IAR and I am using CCS.  Also I am using the earlier variant, CC2640F128 so I dont know if that changes things.

    What I was able to do was copy the BLE stack directory to another location (C:\BLE\ti\simplelink\ble_sdk_2_02_01_18\src) and change the paths in Project->Properties>Linked Resources to match.  I could not change TI_PRODUCTS_DIR and TI_PRODUCTS_DIR__TIREX.  So I substituted the full path for TI_PRODUCTS_DIR__TIREX for those files   This got me to good builds.

    As you probably know, the actual source code is in  ble_sdk_2_02_01_18\src.   You could probably copy that to another place, such as your workspace and limit your VC/backups to that but I haven't tried that. 

    Mark

  • Hi Mark,

    That's my feeling too.  Thanks for the pointers on the paths; it's definitely to do with the environment variables or paths but I suspect it's ones that aren't available through the main interface, which is where problems occur.

    Thanks

    Richard

  • Also check your tools setup through:  Windows -> Preferences -> Code Composer Studio -> Products

  • - Since you are using IAR, I suggest opening a new post for your issue. Note that enabling "All" output messages in IAR can show more verbose error details than the default "Messages" output setting.

    - Have you considered using projectspec files? You can control the path and whether they are copied to your workspace. As shown in the SIMPLELINK-CC2640R2-SDK-BLE-EXAMPLE-PACK, you can maintain source files outside of the SDK provided you update the respective include and linker paths.

    Best wishes