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.

RTOS/CC2640R2F: Replacing CC26xx_app_oad.cmd

Part Number: CC2640R2F

Tool/software: TI-RTOS

Hi,

since CC26xx_app_oad.cmd is externally referenced from the BSP (this is the linker command script for the OAD version), I would like do copy It to my project so I can make edits to I without affecting other projects using the same SDK.

When replacing it, I took the following steps,

Removed the SDK linker command file reference from the Properties->Build->ARM Linker->file search path.

Copied the file referenced in the previous step to my project_loc root.

Added this file to the Linker Command File entry in the field: Properties->General.

After this, I try to rebuild the project, but it misses the 'ICALL_STACK0_ADDR' definition.

For this reason, I have added all definitions from the stack's ccs_compiler_defines.bcfg file to my Application's Properties->Build->ARM Linker->Advanced Options-> Command File Preprocessing macro's.

Is there a way where I do not have to manually add these definitions and just use the ccs_compiler_defines.bcfg file again without using the SDK's linker command script?

Thanks,

  • Hello,

    The issue you are encountering is due to link order.
    The cc26xx_app_oad.cmd file requires that the boundary definitions that are written by the frontier tool (i.e. ICALL_STACK0_ADDR) are required to be read by the linker before the main linker file (cc26xx_app_oad.cmd) because the main linker file depends on them.

    The TI ARM compiler will process linker scripts in order, so the default is to process the ccs_linker_defines.cmd before cc26xx_app_oad.cmd this order must be respected in order for the projects to build correctly, I was able to achieve this by doing the following edits to simple_peripheral_cc2640r2lp_oad_offchip_app.projectspec (it would apply to other oad projects as well)

    Under linkerBuildOptions: I changed:
    -l${SRC_BLE_DIR}/common/cc26xx/ccs/cc26xx_app_oad.cmd
    to
    -l${PROJECT_LOC}/TOOLS/cc26xx_app_oad.cmd

    and I changed
    <file path="SRC_BLE_DIR/common/cc26xx/ccs/cc26xx_app_oad.cmd" openOnCreation="" excludeFromBuild="true" action="link" targetDirectory="TOOLS" createVirtualFolders="true" applicableConfigurations="FlashROM"/>

    to
    <file path="SRC_BLE_DIR/common/cc26xx/ccs/cc26xx_app_oad.cmd" openOnCreation="" excludeFromBuild="true" action="copy" targetDirectory="TOOLS" createVirtualFolders="true" applicableConfigurations="FlashROM"/>

    The key step above is changing the action = copy.
    Then I re-imported the project to my CCS workspace and I saw that the cc26xx_app_oad.cmd has now been copied in and the linker will reference it properly after the defines in ccs_linker_defines.cmd