Tool/software: Code Composer Studio
I have encountered a somewhat maddening linker problem while working with the dual "app & stack" development methodology used for SimpleLink BLE projects. I do not think this problem is specifically related to that, so I am posting in this forum instead. I am using CCS7 with BLE SDK 2.2.0.31 and TI-RTOS 2.18.0.3. I started development using the SimpleBLEPeripheral example project, and significantly modified the "app" portion while leaving the "stack" part intact. In order to facilitate easier inclusion in a revision control system (Git), I moved the unique source and project files to my workspace, and linked to the common, unmodified files that remained in the SDKs. After some tweaking of the project properties, I was able to build the separate app and stack projects in my workspace, including, in particular, the stack-project-generated ccs_linker_defines.cmd used by the app to find the BLE stack function entry point and set available FLASH/RAM limits. For example:
/*
** Stack Frontier Generator 1.1.0 (2016-05-16 20:46:03.194000)
** ** WARNING - Auto-generated file. Modifications could be lost!
*/
--define=ICALL_RAM0_START=0x20004368
--define=ICALL_STACK0_START=0xf000
--define=ICALL_STACK0_ADDR=0xf001
This must occur in link order before the normal command file C:\ti\simplelink\ble_sdk_2_02_01_18\src\common\cc26xx\ccs\cc26xx_app.cmd
In my app project, I created a new linked resource path variable called STACK_PROJ_LOC, which I gave the value ${WORKSPACE_LOC}\ble_stack, and used that for locating ccs_linker_defines.cmd. Both ccs_linker_defines.cmd and cc26xx_app.cmd appear as linked files in the top directory of the project. Also, under Properties->Build->Link Order, I added the two files and arranged them so that ccs_linker_defines.cmd is on top. Building the project generates ccsObjs.opt like this:
“C:/workspace_ccs7/ble_stack/ccs_linker_defines.cmd" "C:/ti/simplelink/ble_sdk_2_02_00_31/src/common/cc26xx/ccs/cc26xx_app.cmd" "./Drivers/PIN/PINCC26XX.obj" "./Drivers/RF/RF.obj" "./Drivers/UART/UART.obj" "./Drivers/UART/UARTCC26XX.obj" "./ble_lib_if/ICall/icall.obj" "./ble_lib_if/ICall/icall_cc2650.obj" "./ble_lib_if/ICallBLE/ble_user_config.obj" "./ble_lib_if/ICallBLE/icall_api.obj" "./ble_lib_if/PROFILES/gatt_uuid.obj" "./ble_lib_if/PROFILES/gattservapp_util.obj" "./config/board.obj" "./config/ccfg_app_ble.obj" "./src/devinfoservice.obj" "./src/devapp.obj" "./src/gatt_profile.obj" "./src/main.obj" "./src/peripheral.obj" "./src/util.obj" -l"configPkg/linker.cmd" -llibc.a -l"C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/bin/ccs/driverlib.lib" -l"C:/ti/simplelink/ble_sdk_2_02_00_31/src/rom/common_rom_releases/03282014/common_rom.symbols"
The generated output is properly memory-limited and links (and runs) correctly with the stack build.
Next, for inclusion into Git, we decided to move the stack directory under the app project directory as a sub-module. After moving files around, I used File->Open Projects from File System... to open the new nested structure. CCS opened both projects (with Git labeling), with the stack showing up as a different project, but also as a directory (and also with Git labeling) inside the app project. I changed STACK_PROJ_LOC to ${PROJECT_LOC}\ble_stack to match the new location of ccs_linker_defines.cmd. I also had to exclude the stack directory from the build to avoid errors. Everything was left the same, including the link order setting. When I build the project now, it generates ccsObjs.opt like this (my emphasis added):
"C:/ti/simplelink/ble_sdk_2_02_00_31/src/common/cc26xx/ccs/cc26xx_app.cmd" "./Drivers/PIN/PINCC26XX.obj" "./Drivers/RF/RF.obj" "./Drivers/UART/UART.obj" "./Drivers/UART/UARTCC26XX.obj" "./ble_lib_if/ICall/icall.obj" "./ble_lib_if/ICall/icall_cc2650.obj" "./ble_lib_if/ICallBLE/ble_user_config.obj" "./ble_lib_if/ICallBLE/icall_api.obj" "./ble_lib_if/PROFILES/gatt_uuid.obj" "./ble_lib_if/PROFILES/gattservapp_util.obj" "./config/board.obj" "./config/ccfg_app_ble.obj" "./src/devinfoservice.obj" "./src/devapp.obj" "./src/gatt_profile.obj" "./src/main.obj" "./src/peripheral.obj" "./src/util.obj" "../ble_stack/ccs_linker_defines.cmd" -l"configPkg/linker.cmd" -llibc.a -l"C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/bin/ccs/driverlib.lib" -l"C:/ti/simplelink/ble_sdk_2_02_00_31/src/rom/common_rom_releases/03282014/common_rom.symbols"
The resulting output is not linked properly with the BLE stack software, and does not work. I tried various combinations of moving files around and renaming, but the result was the same. In particular, it does not seem like the link order setting has any effect at all. The only thing I got to work (and match my original two-directory project) was by copying cc26xx_app.cmd into the ble_stack directory, and changing its name so that it occurred alphabetically after ccs_linker_defines.cmd (in which case, it ended up at the end of the link line, but at least after ccs_linker_defines.cmd).
Is there some reason the link order is not working? Is my method of nesting these projects not allowed?
Thanks for any help you can provide.
dave