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.

CCS/EK-TM4C1294XL: Linker failure, while tying to use UDP

Part Number: EK-TM4C1294XL

Tool/software: Code Composer Studio

I am trying to start something up through the ethernet using UDP.

I found some UDP_ECHO project out there and have copied a few statements from that.

I have included lwip/udp.h and the whole thing now comes as far as the linker process. (Had major problems finding and copying various deeper lying .h files handling IP architecture among other things)

But the linker drops out, because it is missing four symbols, all apparently in the upd_pcb struct. (and now somewhere in my main.obj)

ip_addr_any

udp_bind

udp_new

udp_recv

Those are the only ones I so far use, so ...

But what am I missing, and how do I tell CCS what to do about it?

  • A certain file missing in a certain directory?
  • Am I missing a declaration somewhere early in my main.c file?
  • Some library is needed for the linker setup?
  • Other

  • Hi,

      There is a enet_tcpecho_server example in the folder <TivaWare_Installation>/examples/boards/ek-tm4c1294xl. The example is a ready to compile CCS project with all the libraries and include path setup already. Why don't use start with this example first and replace the enet_tcpecho_server.c with your own udp main file. In your udp file you need to have include the lwip/udp.h. 

    #include <stdbool.h>
    #include <stdint.h>
    #include "inc/hw_ints.h"
    #include "inc/hw_memmap.h"
    #include "driverlib/flash.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/gpio.h"
    #include "driverlib/rom_map.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/systick.h"
    #include "utils/lwiplib.h"
    #include "utils/ustdlib.h"
    #include "utils/uartstdio.h"
    #include "drivers/pinout.h"
    #include "lwip/udp.h"

  • I finally found that ex. It compiles and links.

    But when I try 'merging' that and my project, I go back to linker fail.

    The funny thing, just discovered, is, that I still zoom through the compile session, to crash in the linker, even though I comment out the TCP and/or UDP includes.

    So where is, say, udp_new defined, if not in "lwip/udp.h"?

    Here is what I get in the Console, when TCP and UDP libraries are not included. Or for that matter are included. No difference!)

    **** Build of configuration Debug for project MRS_Setup_Controller ****
    
    /home/vv07/ti/ccs1000/ccs/utils/bin/gmake -k all 
     
    Building file: "../Main.c"
    Invoking: ARM Compiler
    "/home/vv07/ti/ccs1000/ccs/tools/compiler/ti-cgt-arm_20.2.0.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -O2 --include_path="/home/vv07/ti/ccs1000/ccs/tools/compiler/ti-cgt-arm_20.2.0.LTS/include" --include_path="/home/vv07/ti/tivaware_c_series_2_1_4_178/lwip" --include_path="/home/vv07/ti/tivaware_c_series_2_1_4_178/third_party/lwip-1.4.1/src/include" --include_path="/home/vv07/ti/tivaware_c_series_2_1_4_178/third_party/lwip-1.4.1/src" --include_path="/home/vv07/ti/tivaware_c_series_2_1_4_178/third_party/lwip-1.4.1/ports/tiva-tm4c129/include" --include_path="/home/vv07/ti/tivaware_c_series_2_1_4_178" --advice:power=all -g --gcc --define=ccs="ccs" --define=PART_TM4C1294NCPDT --define=TARGET_IS_TM4C129_RA1 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --ual --preproc_with_compile --preproc_dependency="Main.d_raw"  "../Main.c"
    "../Main.c", line 66: remark #1527-D: (ULP 2.1) Detected SW delay loop using empty loop. Recommend using a timer module instead
    Finished building: "../Main.c"
     
    Building target: "MRS_Setup_Controller.out"
    Invoking: ARM Linker
    "/home/vv07/ti/ccs1000/ccs/tools/compiler/ti-cgt-arm_20.2.0.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -O2 --advice:power=all -g --gcc --define=ccs="ccs" --define=PART_TM4C1294NCPDT --define=TARGET_IS_TM4C129_RA1 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --ual -z -m"blinky_ccs.map" --stack_size=512 --heap_size=0 -i"/home/vv07/ti/ccs1000/ccs/tools/compiler/ti-cgt-arm_20.2.0.LTS/lib" -i"/home/vv07/ti/ccs1000/ccs/tools/compiler/ti-cgt-arm_20.2.0.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="MRS_Setup_Controller_linkInfo.xml" --rom_model -o "MRS_Setup_Controller.out" "./Main.obj" "./startup_ccs.obj" "../blinky_ccs.cmd"  -llibc.a -l"/home/vv07/ti/tivaware_c_series_2_1_4_178/driverlib/ccs/Debug/driverlib.lib" 
    <Linking>
     
     undefined   first referenced
      symbol         in file     
     ---------   ----------------
     ip_addr_any ./Main.obj      
     lwIPInit    ./Main.obj      
     udp_bind    ./Main.obj      
     udp_new     ./Main.obj      
     udp_recv    ./Main.obj      
     
    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "MRS_Setup_Controller.out" not built
    remark #10371-D: (ULP 1.1) Detected no uses of low power mode state changing instructions
     
    >> Compilation failure
    makefile:140: recipe for target 'MRS_Setup_Controller.out' failed
    gmake: *** [MRS_Setup_Controller.out] Error 1
    gmake: Target 'all' not remade because of errors.
    
    **** Build Finished ****  

    Or have I misunderstood writing / building / compiling / linking C code completely?

    (I come from Arduino, which has a somewhat limited but more easily understood environment. And then, of course Delphi)

  • HI,

    Do you have the lwiplib.c file linked in like below?

    The lwiplib.c has include to all lwip source files including the udp.c file where these functions are defined.

    If you have these undefined symbols it usually means that the compiler only found the header files during compiling but during linking the definition of these functions are not there. 

     If you still cannot resolve then can you send me your complete UDP code so I can see if I can reproduce it. These functions like udp_new() are declared in udp.h. 

  • A colleague showed up physically at work today.

    He did something with copying files/declarations in the Project Explorer similar to the above shown.

    Project now goes all the way through without errors. A few warnings. (I know about those)

    This CCS is definitely not as easy to use as Arduino, but I can probably do a lot more here, when I learn how to.