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.

Failed to link source code for debug session

Hello,

I'm trying to import a SCONS project into CCS which is with GCC compiler to debug on Launch-CC26X2R1 board. The project can be built with command line and CCS not, the debug session can also be triggered successfully with XDS110 USB Debug port, but no source code can be linked:

The assembly code can be step executed, but the source code can't be located successfully.

I clicked the button "Preferences...", and the source code should have been linked:

I also compared the settings with other projects imported from SimpleLink SDK examples, but can't find the clue to resolve this issue.

Could anyone please help me on this?

Thanks,

Xiaofeng

  • Hello Xiaofeng,

    Based on the messages in the editor and the lack of debug information in the disassembly view, it looks like this progam may have been compiled with minimal debug information generated. Is that the case? Or were symbols stripped afterwards?

    Thanks

    ki

  • Hi Ki,

    Thanks you for getting back to me quickly!

    Actually when this issue happened, I already checked the build command to make sure the symbols were not stripped and optimized. Currently, the c file is built to obj file with "-O0" option, and the elf file was linked without special options:

    The compilation options:

    /Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc @"/Users/xiaofenglei/workspace/TI/sme/ecu/syscfg/ti_ble_app_config.opt" @"/Users/xiaofenglei/workspace/TI/sme/ecu/syscfg/ti_build_config.opt" @"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/config/build_components.opt" @"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/config/factory_config.opt" -mcpu=cortex-m4 -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DFLASH_ROM_BUILD=2 -DDeviceFamily_CC26X2 -DFREERTOS -DNVOCMP_POSIX_MUTEX -ffunction-sections -fdata-sections -g -gstrict-dwarf -Wall -Wno-comment -MMD -MP -MF"Debug/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/kernel/freertos/dpl/ClockPCC26X2_freertos.d" -MT"Debug/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/kernel/freertos/dpl/ClockPCC26X2_freertos.obj" -std=c99 -O0 -I"/Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include" -I"/Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include/newlib-nano" -I"/Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/include" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/common/cc26xx" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/common/cc26xx/freertos" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/controller/cc26xx/inc" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/hal/src/inc" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/hal/src/target/_common" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/hal/src/target/_common/cc26xx" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/heapmgr" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/icall/inc" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/icall/src" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/icall/src/inc" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/inc" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/osal/src/inc" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/profiles/dev_info" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/profiles/simple_profile" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/profiles/simple_profile/cc26xx" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/rom" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/services/src/saddr" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/services/src/sdata" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/common/cc26xx" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/common/cc26xx/uartlog" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/common/nv" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/devices/cc13x2_cc26x2" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/posix/gcc" -I"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/posix/gcc" -I"/Users/xiaofenglei/ti/FreeRTOSv202112.00/FreeRTOS/Source/include" -I"/Users/xiaofenglei/ti/FreeRTOSv202112.00/FreeRTOS/Source/portable/GCC/ARM_CM4F" -I"/Users/xiaofenglei/workspace/TI/sme/ecu" -I"/Users/xiaofenglei/workspace/TI/sme/ecu/app" -I"/Users/xiaofenglei/workspace/TI/sme/ecu/config" -I"/Users/xiaofenglei/workspace/TI/sme/ecu/lib/std_seedkey/lib/include" -I"/Users/xiaofenglei/workspace/TI/sme/ecu/profiles" -I"/Users/xiaofenglei/workspace/TI/sme/ecu/syscfg" -DDEBUG=TRUE -DHW_REV_GAMMA=TRUE -c /Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/kernel/freertos/dpl/ClockPCC26X2_freertos.c -o Debug/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/kernel/freertos/dpl/ClockPCC26X2_freertos.obj

    The link options:

    @"/Users/xiaofenglei/workspace/TI/sme/ecu/syscfg/ti_ble_app_config.opt"
    @"/Users/xiaofenglei/workspace/TI/sme/ecu/syscfg/ti_build_config.opt"
    @"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/config/build_components.opt"
    @"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source/ti/ble5stack/config/factory_config.opt"
    -mcpu=cortex-m4
    -march=armv7e-m
    -mthumb
    -mfloat-abi=hard
    -mfpu=fpv4-sp-d16
    -DFLASH_ROM_BUILD=2
    -DDeviceFamily_CC26X2
    -DFREERTOS
    -DNVOCMP_POSIX_MUTEX
    -ffunction-sections
    -fdata-sections
    -g
    -gstrict-dwarf
    -Wall
    -Wno-comment
    -MMD
    -MP
    -MF"${TARGET.dir}/${TARGET.filebase}.d"
    -MT"${TARGET.dir}/${TARGET.filebase}.obj"
    -std=c99
    --specs=nano.specs
    -nostartfiles
    -static
    -Wl,--gc-sections
    -DPAGE_ALIGN=-1
    -DCC2642=1
    -L"/Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/include"
    -L"/Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/lib"
    -L"/Applications/ti/simplelink_cc13xx_cc26xx_sdk_5_30_01_01/source"
    -L"/Users/xiaofenglei/workspace/TI/sme/ecu/syscfg"
    -Wl,-Map,"Debug/SME_BLE.map"

    -Wl,-T"config/CC26X2R1_LAUNCHXL_FREERTOS.lds"
    -l:ti_utils_build_linker.cmd.genlibs
    -l:ti/ble5stack/libraries/cc26x2r1/OneLib.a
    -l:ti/ble5stack/libraries/cc26x2r1/StackWrapper.a
    -l:ti/ble5stack/libraries/cc26x2r1/ble_r2.symbols
    -l:ti/devices/cc13x2_cc26x2/driverlib/bin/gcc/driverlib.lib
    -lc
    -lgcc
    -lm
    -lnosys

    Please suggest the possible error.

    Thanks,

    Xiaofeng

  • If you open the Modules view and select 'main' from the list of functions like below, what do you see?

  • You should've pointed the key point! I checked the view, but I can't find the "main" function at all:

    It's some weird to see this result. And from the build command, the main_freertos.obj should have been linked, and I can see the address for the main is in the right place in map file. Do you know what might cause this result?

    Thanks,

    Xiaofeng

  • I also do not see "localProgramStart" like it appears in my screenshot. That explains why in the screenshot for your callstack, main and localProgramStart did not reference source files but in mine it does:

    Do the source files that that contain main and localProgramStart for your program appear in the list of files in the Symbol Browser?

    If possible, can you share your out file? If you wish to share privately, please start a private E2E conversation with me.

    Thanks

    ki

  • Hi Ki,

    There is no source code related to localProgramStart, but I do see it in the symbols list with nm on ".out" file. I don't see the way to upload the out file, maybe we can use the E2E conversation you mentioned to provide more information.

    Thanks,

    Xiaofeng

  • Let us continue the discussion in our private E2E conversation.

  • With Ki's help, this issue is resolved! Thanks Ki.

  • The issue was resolved off-line. For those following the thread, the root cause is a bug with the new symbol manager that was introduced in CCS 11.x. The workaround is to have the debugger revert to using the old symbol manager that still comes with CCS.

    Steps:

    1) launch debugger

    2) connect to target

    3) type in "symbol_loader=1" in the expressions view and press enter

    4) load the program

    Thanks

    ki

  • A bug was filed for this issue. Tracking link: https://sir.ext.ti.com/jira/browse/EXT_EP-10725

    Thanks

    ki