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/TM4C123GH6PM: Where to declare functions used in the RTOS Config file?

Part Number: TM4C123GH6PM
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hello,

I think quite a simple question. If i am adding timers or taks through the rtos gui in the rtos config file, and the function is in a seperate source file with its own header i am getting an "Undefined Symbol" error for the functions to be called. Witch makes sense.

How to include the declaration to the config file? Or better how to do it right :)

Thank you very much

  • If the linker is complaining about the undefined symbol, it means that either your separate compilation unit is not being linked in, or there is some other reason the linker doesn't see your function. Are you using CCS? Can you clean and rebuild and post the complete output from the console window?
  • Yes i am Using CCS. Console output as follows:

    **** Build of configuration Debug for project Zelltester ****

    "C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
    'Building file: ../rtos.cfg'
    'Invoking: XDCtools'
    "C:/ti/xdctools_3_32_01_22_core/xs" --xdcpath="C:/ti/tirex-content/tirtos_tivac_2_16_00_08/packages;C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/tidrivers_tivac_2_16_00_08/packages;C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages;C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/ndk_2_25_00_09/packages;C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/uia_2_00_05_50/packages;C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/ns_1_11_00_10/packages;C:/ti/ccsv6/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.M4F -p ti.platforms.tiva:TM4C123GH6PM -r release -c "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS" --compileOptions "-mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -Ooff --opt_for_speed=0 --include_path=\"C:/Users/rico/workspace_v6_2/Zelltester\" --include_path=\"C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b\" --include_path=\"C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/posix\" --include_path=\"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/include\" -g --gcc --define=ccs=\"ccs\" --define=PART_TM4C123GH6PM --define=ccs --define=TIVAWARE --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi " "../rtos.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring rtos.xem4f from package/cfg/rtos_pem4f.cfg ...
    generating custom ti.sysbios library makefile ...
    Starting build of library sources ...
    making C:/Users/rico/workspace_v6_2/Zelltester/src/sysbios/sysbios.aem4f ...
    gmake[1]: Entering directory `C:/Users/rico/workspace_v6_2/Zelltester/src/sysbios'
    clem4f C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/BIOS.c ...
    asmem4f C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/family/arm/m3/Hwi_asm.sv7M ...
    asmem4f C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/family/arm/m3/Hwi_asm_switch.sv7M ...
    asmem4f C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/family/arm/m3/IntrinsicsSupport_asm.sv7M ...
    asmem4f C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/family/arm/m3/TaskSupport_asm.sv7M ...
    arem4f BIOS.obj m3_Hwi_asm.obj m3_Hwi_asm_switch.obj m3_IntrinsicsSupport_asm.obj m3_TaskSupport_asm.obj ...
    gmake[1]: Leaving directory `C:/Users/rico/workspace_v6_2/Zelltester/src/sysbios'
    Build of libraries done.
    clem4f package/cfg/rtos_pem4f.c ...
    'Finished building: ../rtos.cfg'
    ' '
    1 Datei(en) kopiert.
    making ../src/sysbios/sysbios.aem4f ...
    gmake[1]: Entering directory 'C:/Users/rico/workspace_v6_2/Zelltester/src/sysbios'
    gmake[1]: Nothing to be done for 'all'.
    gmake[1]: Leaving directory 'C:/Users/rico/workspace_v6_2/Zelltester/src/sysbios'
    'Building file: ../CANDriver.cpp'
    'Invoking: ARM Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -Ooff --opt_for_speed=0 --include_path="C:/Users/rico/workspace_v6_2/Zelltester" --include_path="C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b" --include_path="C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/posix" --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/include" -g --gcc --define=ccs="ccs" --define=PART_TM4C123GH6PM --define=ccs --define=TIVAWARE --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency="CANDriver.d" --cmd_file="configPkg/compiler.opt" "../CANDriver.cpp"
    'Finished building: ../CANDriver.cpp'
    ' '
    'Building file: ../EK_TM4C123GXL.c'
    'Invoking: ARM Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -Ooff --opt_for_speed=0 --include_path="C:/Users/rico/workspace_v6_2/Zelltester" --include_path="C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b" --include_path="C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/posix" --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/include" -g --gcc --define=ccs="ccs" --define=PART_TM4C123GH6PM --define=ccs --define=TIVAWARE --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency="EK_TM4C123GXL.d" --cmd_file="configPkg/compiler.opt" "../EK_TM4C123GXL.c"
    'Finished building: ../EK_TM4C123GXL.c'
    ' '
    'Building file: ../Zelltester.cpp'
    'Invoking: ARM Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -Ooff --opt_for_speed=0 --include_path="C:/Users/rico/workspace_v6_2/Zelltester" --include_path="C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b" --include_path="C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/posix" --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/include" -g --gcc --define=ccs="ccs" --define=PART_TM4C123GH6PM --define=ccs --define=TIVAWARE --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency="Zelltester.d" --cmd_file="configPkg/compiler.opt" "../Zelltester.cpp"
    'Finished building: ../Zelltester.cpp'
    ' '
    'Building file: ../rtos.cpp'
    'Invoking: ARM Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -Ooff --opt_for_speed=0 --include_path="C:/Users/rico/workspace_v6_2/Zelltester" --include_path="C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b" --include_path="C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/posix" --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/include" -g --gcc --define=ccs="ccs" --define=PART_TM4C123GH6PM --define=ccs --define=TIVAWARE --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency="rtos.d" --cmd_file="configPkg/compiler.opt" "../rtos.cpp"
    'Finished building: ../rtos.cpp'
    ' '
    'Building target: Zelltester.out'
    'Invoking: ARM Linker'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -Ooff --opt_for_speed=0 -g --gcc --define=ccs="ccs" --define=PART_TM4C123GH6PM --define=ccs --define=TIVAWARE --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi -z -m"Zelltester.map" --stack_size=512 --heap_size=0 -i"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/lib" -i"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/include" --reread_libs --warn_sections --diag_wrap=off --display_error_number --xml_link_info="Zelltester_linkInfo.xml" --rom_model -o "Zelltester.out" "./CANDriver.obj" "./EK_TM4C123GXL.obj" "./Zelltester.obj" "./rtos.obj" "../EK_TM4C123GXL.cmd" -l"configPkg/linker.cmd" -l"C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b/grlib/ccs/Debug/grlib.lib" -l"C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b/usblib/ccs/Debug/usblib.lib" -l"C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b/driverlib/ccs/Debug/driverlib.lib" -llibc.a
    <Linking>
    warning #10229-D: output section ".data" refers to load symbol "task0fxn" and hence cannot be compressed; compression "rle" is ignored

    undefined first referenced
    symbol in file
    --------- ----------------

    task0fxn C:\Users\rico\workspace_v6_2\Zelltester\Debug\configPkg\package\cfg\rtos_pem4f.oem4f
    >> Compilation failure
    makefile:146: recipe for target 'Zelltester.out' failed

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "Zelltester.out" not built
    gmake: *** [Zelltester.out] Error 1
    gmake: Target 'all' not remade because of errors.

    **** Build Finished ****
  • I am guessing that your task0fxn is defined in Zelltester.cpp or rtos.cpp, which are both compiled as C++ files. You need to use an extern C block to make task0fxn visible. Go to products\bios_<version>\docs in your TI-RTOS installation, and open BIOS User's Guide. Section 1.5 Using C++ with SYS/BIOS contains more information and some examples for your use case.