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.

TM4C129XNCZAD: undefined first referenced symbol in file

Part Number: TM4C129XNCZAD
Other Parts Discussed in Thread: SYSBIOS,

Hi Team,

We are trying to build the old code base and facing a linking issue and getting an error like "main      C:\ti6\ccsv6\tools\compiler\arm_5.1.6\lib\rtsv7M4_T_le_v4SPD16_eabi.lib<args_main.obj>".

The product is already in field and need to fix the field bugs. Please help me on this, find the attached image for reference (Console, error and linker). 

Used Tools: Code Composer Studio Version: 6.0.1.00040 

 .

Thanks,

Krishna

  • Hello Krishna,

    Do you have a source file with 'main' in your project? Do you have any source files in your project at all? I see a 'src' folder in the Project Explorer but it is unclear what the contents of it are.

    Thanks

    ki

  • Hi Ki,

    Thank you very much for reply,

    Yes, We have a source file with main in our project. It's there in a src->Arm->ArmTMDApp folder. Please refer attached image.

    Thanks,

    Krishna

  • Can you post the full text output from the CDT Build Console when the linker error has occurred?

    Not sure if the object file for main.cpp isn't being passed to the linker or if there is some other issue.

  • Hi Ki,

    Please check below line for consol log.


    **** Build of configuration Debug for project Target_V1 ****

    "C:\\ti6\\ccsv6\\utils\\bin\\gmake" -k all
    making ../src/sysbios/sysbios.aem4f ...
    gmake[1]: Entering directory `C:/ti6/Target_V1/src/sysbios'
    clem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/BIOS.c ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/m3/Clobber_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/m3/IntrinsicsSupport_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/m3/TaskSupport_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/m3/Hwi_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/m3/Hwi_asm_switch.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/CTM_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/Core_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/omap4430/Power_saveCpu.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/omap4430/Power_resumeCpu.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/smp/Power_saveCpu.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/smp/Power_resumeCpu.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/timers/dmtimer/Timer_asm.sv7M ...
    arem4f BIOS.obj m3_Clobber_asm.obj m3_IntrinsicsSupport_asm.obj m3_TaskSupport_asm.obj m3_Hwi_asm.obj m3_Hwi_asm_switch.obj ducati_CTM_asm.obj ducati_Core_asm.obj omap4430_Power_saveCpu.obj omap4430_Power_resumeCpu.obj smp_Power_saveCpu.obj smp_Power_resumeCpu.obj dmtimer_Timer_asm.obj ...
    gmake[1]: Leaving directory `C:/ti6/Target_V1/src/sysbios'
    'Building file: ../app.cfg'
    'Invoking: XDCtools'
    "C:/ti6/xdctools_3_30_03_47_core/xs" --xdcpath="C:/ti6/bios_6_40_01_15/packages;C:/ti6/ccsv6/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.M4F -p ti.platforms.tiva:TM4C129XNCZAD -r release -c "C:/ti6/ccsv6/tools/compiler/arm_5.1.6" --compileOptions "-g --optimize_with_debug" "../app.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring app.xem4f from package/cfg/app_pem4f.cfg ...
    generating custom ti.sysbios library makefile ...
    Starting build of library sources ...
    making C:/ti6/Target_V1/src/sysbios/sysbios.aem4f ...
    gmake[1]: Entering directory `C:/ti6/Target_V1/src/sysbios'
    gmake[1]: Nothing to be done for `all'.
    gmake[1]: Leaving directory `C:/ti6/Target_V1/src/sysbios'
    Build of libraries done.
    clem4f package/cfg/app_pem4f.c ...
    'Finished building: ../app.cfg'
    ' '
    'Building target: Target_V1.out'
    'Invoking: ARM Linker'
    "C:/ti6/ccsv6/tools/compiler/arm_5.1.6/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -g --gcc --define=ccs="ccs" --define=PART_TM4C129XNCZAD --display_error_number --diag_warning=225 --diag_wrap=off -z -m"Target_V1.map" --heap_size=0 --stack_size=512 -i"C:/ti6/ccsv6/tools/compiler/arm_5.1.6/lib" -i"C:/ti6/ccsv6/tools/compiler/arm_5.1.6/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --xml_link_info="Target_V1_linkInfo.xml" --rom_model -o "Target_V1.out" -l"./configPkg/linker.cmd" "../TM4C129XNCZAD.cmd" -l"libc.a" -l"driverlib.lib"
    <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------
    main C:\ti6\ccsv6\tools\compiler\arm_5.1.6\lib\rtsv7M4_T_le_v4SPD16_eabi.lib<args_main.obj>

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "Target_V1.out" not built

    >> Compilation failure
    gmake: *** [Target_V1.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

    Thanks,

    Krishna

  • Please check below line for consol log.

    In the part for 'Invoking: ARM Linker' I can't see main.o being passed to the linker, not any other other objects from project source files in the src directory.

    Yes, We have a source file with main in our project. It's there in a src->Arm->ArmTMDApp folder

    I think a project sub-directory named src is handled as a special case in CCS SYS/BIOS based projects for SYS/BIOS created files, and gets excluded by CCS from the build process.

    Perhaps Ki can confirm if this is the cause of the issue.

    The product is already in field and need to fix the field bugs.

    Do you know if when the project was previously successfully compiled the project source files were in a src sub-directory, or has the directory been renamed?

  • I think a project sub-directory named src is handled as a special case in CCS SYS/BIOS based projects for SYS/BIOS created files, and gets excluded by CCS from the build process.

    That is correct, the src file is generated from SYS/BIOS and typically gets excluded from the build. However I would expect to see the 'src' folder greyed out and with a 'slash' through it to indicate that it is excluded. But this behavior may have been in more recent CCS versions. CCSv6 is very old and the src file may be getting excluded by some 'exclude' file in the root directory (if I remember correctly)

    Krishna - did you add your own custom source files to the 'src' folder? Or are all the content in there generated by RTSC?

    Thanks

    ki

  • Hi Ki, 

    I added my custom files into src folder. 

    Thanks,

    Krishna

  • CCSv6 is very old and the src file may be getting excluded by some 'exclude' file in the root directory (if I remember correctly)

    Having imported an example from TI-RTOS for TivaC - 2.16.00.08 into CCS 11:

    1. After performing the build a src sub-directory has been created, which contains a .exclude file with the contents:

    This file exists to prevent Eclipse/CDT from adding the C sources contained in this directory (or below) to any enclosing project.

    2. After the build had finished, the src directory wasn't greyed out with a 'slash' through it. Performing a refresh in the CCS Project Explorer didn't changing the display of the src directory.

    3. After restarting CCS the src directory was then greyed out with a 'slash' through it.

    I.e. it looks like there can be an intermediate state where the SYS/BIOS build process has created a src/.exclude file but the CCS Project Explorer doesn't show it.

  • I added my custom files into src folder. 

    Can you create a folder with a different name, move your custom files into the new folder, and then perform a rebuild of the project?

    Suspect the use of the 'src' folder is conflicting with the SYS/BIOS build process which creates the src/.exclude file which then prevents CCS from attempting to compile the custom files in the 'src' folder.

    You might have to update the CCS project properties for Build -> Arm Compiler -> Include Options to allow the include files in the changed directory to be found.

  • 2. After the build had finished, the src directory wasn't greyed out with a 'slash' through it. Performing a refresh in the CCS Project Explorer didn't changing the display of the src directory.

    Interesting. I also imported an example from TI-RTOS for TivaC - 2.16.00.08 into CCS 11. In my case I also see a .exclude file AND the src folder got excluded also. I did NOT need to restart CCS.

    Krishna - check to see if there is a .exclude file in the 'src' folder. If so, that explains the behavior you see. Note that the .exclude file will not appear in the Project Explorer view by default. You will need to change the filter for that. The easiest thing is to just browse to the folder in Windows and see if the file exists there


  • Suspect the use of the 'src' folder is conflicting with the SYS/BIOS build process which creates the src/.exclude file which then prevents CCS from attempting to compile the custom files in the 'src' folder.

    Agreed. This is likely the case.

  • Hi Ki,

    Thanks for your continous support.

    Before renaming the 'src' directory it's having a ".exclude". file. As per your suggestion renamed the src directory by test refer(Image-2). All custom files moved into the test folder. After that opend test folder manually it's having a ".exclude" file refer(Image-3). 

    After compilation automatically src folder created and it's having a ".exclude" file (Image-1). As per above info ".exclude" file stoping the copilation. Manually removed the ".exclude" file in test folder and compiled and got an error like illegal character (Image-4). 

    Conclusion: Renamed src folder with test and removed ".exclude" file in test folder manually and compiled, getting an error like illegal charatcer refer image-4. 

    1) Image-1

    .After copilation automatically src file created

    2) Image-2

    3) Image-3

    4) Image-4

    Thanks,

    Krishna

  • Conclusion: Renamed src folder with test and removed ".exclude" file in test folder manually and compiled, getting an error like illegal charatcer refer image-4. 

    Instead of renaming src, please manually create a new (empty) folder and then manually move just your custom files to it. This will ensure that all the files in the new folder is your custom files and the src folder only has generated RTSC files.

  • Hi Ki,

    Created a new project (Test 450) and after that added empty folder like "source_files" copied all custom files into the source_files folder and updated build settings. After compilation getting an error like below.

    **** Build of configuration Debug for project Test450 ****

    "C:\\ti6\\ccsv6\\utils\\bin\\gmake" -k all
    source_files/TivaWare/third_party/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Eclipse/subdir_rules.mk:7: warning: overriding commands for target `configPkg/linker.cmd'
    subdir_rules.mk:7: warning: ignoring old commands for target `configPkg/linker.cmd'
    source_files/TivaWare/third_party/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Eclipse/subdir_rules.mk:16: warning: overriding commands for target `configPkg/linker.cmd'
    source_files/TivaWare/third_party/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Eclipse/subdir_rules.mk:7: warning: ignoring old commands for target `configPkg/linker.cmd'
    making ../src/sysbios/sysbios.aem4f ...
    gmake[1]: Entering directory `C:/ti6/Test450/src/sysbios'
    clem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/BIOS.c ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/m3/Clobber_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/m3/IntrinsicsSupport_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/m3/TaskSupport_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/m3/Hwi_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/m3/Hwi_asm_switch.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/CTM_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/Core_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/omap4430/Power_saveCpu.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/omap4430/Power_resumeCpu.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/smp/Power_saveCpu.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/smp/Power_resumeCpu.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/timers/dmtimer/Timer_asm.sv7M ...
    arem4f BIOS.obj m3_Clobber_asm.obj m3_IntrinsicsSupport_asm.obj m3_TaskSupport_asm.obj m3_Hwi_asm.obj m3_Hwi_asm_switch.obj ducati_CTM_asm.obj ducati_Core_asm.obj omap4430_Power_saveCpu.obj omap4430_Power_resumeCpu.obj smp_Power_saveCpu.obj smp_Power_resumeCpu.obj dmtimer_Timer_asm.obj ...
    gmake[1]: Leaving directory `C:/ti6/Test450/src/sysbios'
    'Building file: ../source_files/TivaWare/third_party/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Eclipse/fury_ft2232_flash.cfg'
    'Invoking: XDCtools'
    "C:/ti6/xdctools_3_30_03_47_core/xs" --xdcpath="C:/ti6/bios_6_40_01_15/packages;C:/ti6/ccsv6/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.M4F -p ti.platforms.tiva:TM4C129XNCZAD -r release -c "C:/ti6/ccsv6/tools/compiler/arm_5.1.6" --compileOptions "-g --optimize_with_debug" "../source_files/TivaWare/third_party/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Eclipse/fury_ft2232_flash.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring fury_ft2232_flash.xem4f from package/cfg/fury_ft2232_flash_pem4f.cfg ...
    js: "C:/ti6/Test450/source_files/TivaWare/third_party/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Eclipse/fury_ft2232_flash.cfg", line 1: illegal character
    js: #daemon configuration
    js: ^
    js: "C:/ti6/Test450/source_files/TivaWare/third_party/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Eclipse/fury_ft2232_flash.cfg", line 1: Compilation produced 1 syntax errors.
    js: "./package/cfg/fury_ft2232_flash_pem4f.cfg", line 184: Compilation produced 1 syntax errors. (C:/ti6/Test450/source_files/TivaWare/third_party/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Eclipse/fury_ft2232_flash.cfg#1)
    gmake.exe: *** [package/cfg/fury_ft2232_flash_pem4f.xdl] Error 1
    js: "C:/ti6/xdctools_3_30_03_47_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 ****

    Thanks,

    Krishna

  • Manually removed the ".exclude" file in test folder and compiled and got an error like illegal character (Image-4). 

    The error is coming the fury_ft2322_flash.cfg file, which looks to be a configuration file for the OpenOCD debugger.

    The CCS build system treats a .cfg file extension as a SYS/BIOS configuration file which results in the error when it tries to compile the OpenOCD configuration file as it was is a SYS/BIOS configuration file.

    If you don't need the file either delete it, change the file extension or right-click it in the CCS Project Explorer and select "Exclude From Build".

  • Hi Chester,

    After excluding the "fury_ft2322_flash.cfg" fle from build, getting an error like below. Please rfeer below consol log lines.


    **** Build of configuration Debug for project Test450 ****

    "C:\\ti6\\ccsv6\\utils\\bin\\gmake" -k all
    source_files/TivaWare/third_party/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Eclipse/subdir_rules.mk:7: warning: overriding commands for target `configPkg/linker.cmd'
    subdir_rules.mk:7: warning: ignoring old commands for target `configPkg/linker.cmd'
    making ../src/sysbios/sysbios.aem4f ...
    gmake[1]: Entering directory `C:/ti6/Test450/src/sysbios'
    clem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/BIOS.c ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/m3/Clobber_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/m3/IntrinsicsSupport_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/m3/TaskSupport_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/m3/Hwi_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/m3/Hwi_asm_switch.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/CTM_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/Core_asm.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/omap4430/Power_saveCpu.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/omap4430/Power_resumeCpu.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/smp/Power_saveCpu.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/family/arm/ducati/smp/Power_resumeCpu.sv7M ...
    asmem4f C:/ti6/bios_6_40_01_15/packages/ti/sysbios/timers/dmtimer/Timer_asm.sv7M ...
    arem4f BIOS.obj m3_Clobber_asm.obj m3_IntrinsicsSupport_asm.obj m3_TaskSupport_asm.obj m3_Hwi_asm.obj m3_Hwi_asm_switch.obj ducati_CTM_asm.obj ducati_Core_asm.obj omap4430_Power_saveCpu.obj omap4430_Power_resumeCpu.obj smp_Power_saveCpu.obj smp_Power_resumeCpu.obj dmtimer_Timer_asm.obj ...
    gmake[1]: Leaving directory `C:/ti6/Test450/src/sysbios'
    'Building file: ../source_files/TivaWare/third_party/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Eclipse/fury_ft2232.cfg'
    'Invoking: XDCtools'
    "C:/ti6/xdctools_3_30_03_47_core/xs" --xdcpath="C:/ti6/bios_6_40_01_15/packages;C:/ti6/ccsv6/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.M4F -p ti.platforms.tiva:TM4C129XNCZAD -r release -c "C:/ti6/ccsv6/tools/compiler/arm_5.1.6" --compileOptions "-g --optimize_with_debug" "../source_files/TivaWare/third_party/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Eclipse/fury_ft2232.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring fury_ft2232.xem4f from package/cfg/fury_ft2232_pem4f.cfg ...
    js: "C:/ti6/Test450/source_files/TivaWare/third_party/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Eclipse/fury_ft2232.cfg", line 1: illegal character
    js: #daemon configuration
    js: ^
    js: "C:/ti6/Test450/source_files/TivaWare/third_party/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Eclipse/fury_ft2232.cfg", line 1: Compilation produced 1 syntax errors.
    js: "./package/cfg/fury_ft2232_pem4f.cfg", line 184: Compilation produced 1 syntax errors. (C:/ti6/Test450/source_files/TivaWare/third_party/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Eclipse/fury_ft2232.cfg#1)
    gmake.exe: *** [package/cfg/fury_ft2232_pem4f.xdl] Error 1
    js: "C:/ti6/xdctools_3_30_03_47_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 ****

    Thanks,

    Krishna

  • After excluding the "fury_ft2322_flash.cfg" fle from build, getting an error like below.

    The fault has moved to the C:/ti6/Test450/source_files/TivaWare/third_party/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Eclipse/fury_ft2232.cfg, which is another .cfg file which is a configuration file for the OpenOCD debugger rather than a SYS/BIOS configuration file.

    I don't know how the project has been setup, but it seems wrong for a SYS/BIOS based project to be including files within a FreeRTOS demo project.

    Are are able to attach the complete project, or failing that just the .ccsproject , .cproject and .project files?