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.

System_printf an unresolved symbol

I'm running into an issue trying to use System_printf() in my project.

Despite putting #include <xdc/runtime/System.h> in my source file, during linking I see System_printf as an unresolved symbol.

Is there something special I need do put in the config to link this in?

Ed Averill

  • Ed,
    do you have
    xdc.useModule("xdc.runtime.System");
    somewhere in your config script? If you do, and you still see the error can you clean and rebuild your project and post the complete console output?
    Also, there is a file linker.cmd in configPkg directory in your project. Please post its content too.

  • Here's the top of my app.cfg, and you can see that System is included:

    var Defaults = xdc.useModule('xdc.runtime.Defaults');
    var Diags = xdc.useModule('xdc.runtime.Diags');
    var Error = xdc.useModule('xdc.runtime.Error');
    var Main = xdc.useModule('xdc.runtime.Main');
    var Memory = xdc.useModule('xdc.runtime.Memory')
    var SysMin = xdc.useModule('xdc.runtime.SysMin');
    var System = xdc.useModule('xdc.runtime.System');
    var Text = xdc.useModule('xdc.runtime.Text');
    
    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    var Clock = xdc.useModule('ti.sysbios.knl.Clock');
    var Swi = xdc.useModule('ti.sysbios.knl.Swi');
    var Task = xdc.useModule('ti.sysbios.knl.Task');
    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');

    Looking at linker.cmd, I see this:
    /*
     * Do not modify this file; it is automatically generated from the template
     * linkcmd.xdt in the ti.platforms.msp430 package and will be overwritten.
     */
    
    /*
     * put '"'s around paths because, without this, the linker
     * considers '-' as minus operator, not a file name character.
     */
    
    
    -l"C:\Users\eaverill\workspace_v6_1\MainBoard_Root\Debug\configPkg\package\cfg\app_pe430X.oe430X"
    -l"C:\Users\eaverill\workspace_v6_1\MainBoard_Root\src\sysbios\sysbios.ae430X"
    -l"C:\ti\tirtos_msp43x_2_12_01_33\products\bios_6_41_04_54\packages\ti\catalog\msp430\init\lib\ti.catalog.msp430.init.ae430X"
    -l"C:\ti\tirtos_msp43x_2_12_01_33\products\bios_6_41_04_54\packages\ti\targets\msp430\rts430\lib\ti.targets.msp430.rts430.ae430X"
    -l"C:\ti\tirtos_msp43x_2_12_01_33\products\bios_6_41_04_54\packages\ti\targets\msp430\rts430\lib\boot.ae430X"
    
    --retain="*(xdc.meta)"
    --retain="*(xdc.noload)"
    
    
    /* Elf symbols */
    --symbol_map __TI_STACK_BASE=_stack
    --symbol_map __TI_STACK_SIZE=_STACK_SIZE
    --symbol_map __TI_STATIC_BASE=__bss__
    --symbol_map __c_int00=_c_int00
    --symbol_map __TI_cleanup_ptr=_cleanup_ptr
    --symbol_map __TI_dtors_ptr=_dtors_ptr
    
    
    --args 0x0
    -heap  0x0
    -stack 0x7d0
    
    /*
     * Linker command file contributions from all loaded packages:
     */
    
    /* Content from xdc.services.global (null): */
    
    /* Content from xdc (null): */
    
    /* Content from xdc.corevers (null): */
    
    /* Content from xdc.shelf (null): */
    
    /* Content from xdc.services.spec (null): */
    
    /* Content from xdc.services.intern.xsr (null): */
    
    /* Content from xdc.services.intern.gen (null): */
    
    /* Content from xdc.services.intern.cmd (null): */
    
    /* Content from xdc.bld (null): */
    
    /* Content from ti.targets (null): */
    
    /* Content from ti.targets.msp430.elf (null): */
    
    /* Content from xdc.rov (null): */
    
    /* Content from xdc.runtime (null): */
    
    /* Content from xdc.services.getset (null): */
    
    /* Content from ti.targets.msp430.rts430 (ti/targets/msp430/rts430/link.xdt): */
    
    /* Definitions for ti.targets.msp430.rts430/boot.o* references:             */
    /*     - ti_targets_msp430_rts430_noexit__I */
    /*           defined in case main() returns in noexit variants              */
    /*           of _c_int00.  Even in this case, we should call xdc.runtime    */
    /*           exit processing; noexit only means that the RTS library's exit */
    /*           handling is unnecessary.                                       */
    --symbol_map ti_targets_msp430_rts430_noexit__I=xdc_runtime_System_exit__E
    
    /* Content from ti.sysbios.interfaces (null): */
    
    /* Content from ti.sysbios.family (null): */
    
    /* Content from ti.sysbios.rts (ti/sysbios/rts/linkcmd.xdt): */
    
    /* Content from xdc.runtime.knl (null): */
    
    /* Content from xdc.platform (null): */
    
    /* Content from ti.catalog.msp430 (null): */
    
    /* Content from ti.catalog (null): */
    
    /* Content from ti.catalog.msp430.init (null): */
    
    /* Content from xdc.cfg (null): */
    
    /* Content from ti.catalog.msp430.peripherals.interrupt (null): */
    
    /* Content from ti.catalog.msp430.peripherals.special_function (null): */
    
    /* Content from ti.catalog.msp430.peripherals.timer (null): */
    
    /* Content from ti.catalog.msp430.peripherals.watchdog (null): */
    
    /* Content from ti.catalog.msp430.peripherals.clock (null): */
    
    /* Content from ti.platforms.msp430 (null): */
    
    /* Content from ti.sysbios.hal (null): */
    
    /* Content from ti.sysbios.knl (null): */
    
    /* Content from ti.sysbios (null): */
    
    /* Content from ti.sysbios.family.msp430 (null): */
    
    /* Content from ti.sysbios.gates (null): */
    
    /* Content from ti.sysbios.xdcruntime (null): */
    
    /* Content from ti.sysbios.heaps (null): */
    
    /* Content from ti.sysbios.utils (null): */
    
    /* Content from configPkg (null): */
    
    /* Content from xdc.services.io (null): */
    
    
    
    /*
     * symbolic aliases for static instance objects
     */
    xdc_runtime_Startup__EXECFXN__C = 1;
    xdc_runtime_Startup__RESETFXN__C = 1;
    TSK_idle = ti_sysbios_knl_Task_Object__table__V + 62;
    
    
    SECTIONS
    {
    
    
    
        xdc.meta: type = COPY
    }
    

    ..I hope this helps...

    Ed Averill

  • That all looks as expected. Can you also post the complete linker command line and the error message?
  • Here you go:

    'Building target: MainBoard_Root.out'
    'Invoking: MSP430 Linker'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/bin/cl430" -vmspx --abi=eabi --data_model=large --code_model=large -O3 --opt_for_speed=3 --use_hw_mpy=F5 --advice:power="all" -g --c99 --define=__MSP430F5638__ --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --printf_support=full -k --asm_listing -z -m"MainBoard_Root.map" --heap_size=160 --stack_size=256 --cinit_hold_wdt=on -i"C:/ti/ccsv6/ccs_base/msp430/include" -i"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/lib" -i"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/include" -i"C:/ti/ccsv6/ccs_base/msp430/lib/5xx_6xx_FRxx" --reread_libs --warn_sections --diag_wrap=off --display_error_number --xml_link_info="MainBoard_Root_linkInfo.xml" --use_hw_mpy=F5 --rom_model -o "MainBoard_Root.out" "./BootDiagnostics.obj" "./Calendar.obj" "./Common.obj" "./Configure.obj" "./EventLogging.obj" "./Networking.obj" "./RS485Comm.obj" "./UI.obj" "./USBTask.obj" "./main.obj" "./TI Ports/grlib/button.obj" "./TI Ports/grlib/checkbox.obj" "./TI Ports/grlib/circle.obj" "./TI Ports/grlib/context.obj" "./TI Ports/grlib/display.obj" "./TI Ports/grlib/image.obj" "./TI Ports/grlib/imageButton.obj" "./TI Ports/grlib/line.obj" "./TI Ports/grlib/radioButton.obj" "./TI Ports/grlib/rectangle.obj" "./TI Ports/grlib/string.obj" "./TI Ports/fonts/fontcm12.obj" "./TI Ports/fonts/fontcm12b.obj" "./TI Ports/fonts/fontcm12i.obj" "./TI Ports/fonts/fontcm14.obj" "./TI Ports/fonts/fontcm14b.obj" "./TI Ports/fonts/fontcm14i.obj" "./TI Ports/fonts/fontcm16.obj" "./TI Ports/fonts/fontcm16b.obj" "./TI Ports/fonts/fontcm16i.obj" "./TI Ports/fonts/fontcmsc12.obj" "./TI Ports/fonts/fontcmsc14.obj" "./TI Ports/fonts/fontcmsc16.obj" "./TI Ports/fonts/fontcmss12.obj" "./TI Ports/fonts/fontcmss12b.obj" "./TI Ports/fonts/fontcmss12i.obj" "./TI Ports/fonts/fontcmss14.obj" "./TI Ports/fonts/fontcmss14b.obj" "./TI Ports/fonts/fontcmss14i.obj" "./TI Ports/fonts/fontcmss16.obj" "./TI Ports/fonts/fontcmss16b.obj" "./TI Ports/fonts/fontcmss16i.obj" "./TI Ports/fonts/fontcmtt12.obj" "./TI Ports/fonts/fontcmtt14.obj" "./TI Ports/fonts/fontcmtt16.obj" "./TI Ports/fonts/fontfixed6x8.obj" "./TI Ports/drv8301/drv8301.obj" "./TI Ports/MSP430 USB/USB_config/UsbIsr.obj" "./TI Ports/MSP430 USB/USB_config/descriptors.obj" "./TI Ports/MSP430 USB/USB_app/usbConstructs.obj" "./TI Ports/MSP430 USB/USB_app/usbEventHandling.obj" "./TI Ports/MSP430 USB/USB_Common/usb.obj" "./TI Ports/MSP430 USB/USB_CDC_API/UsbCdc.obj" "./TI Ports/LCD_Driver/NHD128x64.obj" "./TI Ports/Closed Loop Control/closed_loop.obj" "./TI Ports/Closed Loop Control/CORE LIB/HAL_FLASH.obj" "./TI Ports/Closed Loop Control/CORE LIB/HAL_PMAP.obj" "./TI Ports/Closed Loop Control/CORE LIB/HAL_PMM.obj" "./TI Ports/Closed Loop Control/CORE LIB/HAL_TLV.obj" "./TI Ports/Closed Loop Control/CORE LIB/HAL_UCS.obj" "./Networking/enc28j60.obj" "./Networking/gpio.obj" "./Networking/ip_arp_udp_tcp.obj" "./Networking/ucs.obj" "./Networking/web.obj" "./Local Libraries/Buttons.obj" "./Local Libraries/Configuration.obj" "./Local Libraries/IOExpander.obj" "./Local Libraries/LCD.obj" "./Local Libraries/MSP430Init.obj" "./Local Libraries/Motor.obj" "./Local Libraries/SafetyDevices.obj" "./Local Libraries/State.obj" "./Local Libraries/StringLib.obj" "./Local Libraries/ULHealthScan.obj" "./Local Drivers/ADC.obj" "./Local Drivers/CRC.obj" "./Local Drivers/FlashIO.obj" "./Local Drivers/I2C.obj" "./Local Drivers/InterruptHandlers.obj" "./Local Drivers/LED.obj" "./Local Drivers/RTC.obj" "./Local Drivers/SPI.obj" "./Local Drivers/TLV.obj" "./Local Drivers/UART.obj" "./GUI/GUI.obj" "./GUI/setup_menu.obj" "../lnk_msp430f5638.cmd" "../TI Ports/MSP430 USB/msp430USB.cmd" -l"./configPkg/linker.cmd"  -l"C:\ti\tirtos_msp43x_2_12_01_33\products\MSPWare_2_00_00_40a\driverlib\ccs-MSP430F5638\ccs-MSP430F5638.lib" -l"libc.a" -l"libmath.a" 
    <Linking>
    remark #10372-D: (ULP 4.1) Detected uninitialized Port A in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
    remark #10372-D: (ULP 4.1) Detected uninitialized Port B in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
    
    remark #10372-D: (ULP 4.1) Detected uninitialized Port C in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
     undefined      first referenced
    remark #10372-D: (ULP 4.1) Detected uninitialized Port D in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
      symbol            in file     
    remark #10372-D: (ULP 4.1) Detected uninitialized Port E in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
     ---------      ----------------
     Systerm_printf ./UI.obj        
    
    error #10234-D: unresolved symbols remain
    
    error #10010: errors encountered during linking; "MainBoard_Root.out" not built
    >> Compilation failure
    gmake: *** [MainBoard_Root.out] Error 1
    gmake: Target `all' not remade because of errors.
    
    **** Build Finished ****
    

  • You misspelled the function name. This is what's in the error message:
    Systerm_printf ./UI.obj
  • Oh geez, I must be low on coffee! Red of face here.. now do I feel stupid...

    Thanks!