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.

TI RTOS Network speed and difference between TaskCreate and Task_create

Hi,

I am using the Tiva C Series Connected Launchpad TM4C1294XL and I have installed the TI RTOS framework. I want to use the NDK for communicating over TCP (LAN) with my Laptop. I used the tcpEcho example for my first experiment. If I connect with netcat (Linux utility) to the Board I can send data to it and get an echo back. Then I wrote a program that connects to the device and is able to send chunks of data with a certain size and speed. This way I was able to find out the maximum speed I can use to send and receive data. I was not able to reach 1 megabit per second. It was very slow. So I decided to play a bit with the packet size but I was not able to improve the speed. I tried different optimization settings and I achieved the highest speed with no optimization at all. That experience was a little bit strange for me.

Is this connected launchpad really this slow or is there something I can improve to gain higher network speed?

Next question: I opened TI's Network developer's kit to learn more about the calls that were used in the example. In the file tcpEchoHooks the task tcpHandler is created using the function Task_create. But all I could find in the NDK was the function TaskCreate. There is nothing that both of them have in common. Task_create has 3 parameters and TaskCreate has 7 parameters.

Why is this the case? How can use TaskCreate and what is the difference to Task_create?

  • Moving it to the TI RTOS Forum
  • Hi Nicolas,

    Nicolas Göddel said:

    I am using the Tiva C Series Connected Launchpad TM4C1294XL and I have installed the TI RTOS framework. I want to use the NDK for communicating over TCP (LAN) with my Laptop. I used the tcpEcho example for my first experiment. If I connect with netcat (Linux utility) to the Board I can send data to it and get an echo back. Then I wrote a program that connects to the device and is able to send chunks of data with a certain size and speed. This way I was able to find out the maximum speed I can use to send and receive data. I was not able to reach 1 megabit per second. It was very slow. So I decided to play a bit with the packet size but I was not able to improve the speed. I tried different optimization settings and I achieved the highest speed with no optimization at all. That experience was a little bit strange for me.

    Is this connected launchpad really this slow or is there something I can improve to gain higher network speed?

    Our NDK expert is out of office today. I will check with him and get back to you on this. In the mean time can you share what optimization settings did you do ?

    Nicolas Göddel said:

    Next question: I opened TI's Network developer's kit to learn more about the calls that were used in the example. In the file tcpEchoHooks the task tcpHandler is created using the function Task_create. But all I could find in the NDK was the function TaskCreate. There is nothing that both of them have in common. Task_create has 3 parameters and TaskCreate has 7 parameters.

    Why is this the case? How can use TaskCreate and what is the difference to Task_create?

    TaskCreate() is a NDK API that internally calls TI-RTOS kernel's Task_create() function.

    Best,

    Ashish

  • I only tried different compiler optimizations. That's all.

  • Hi Nicolas,

    I checked with our NDK expert and learned that we unfortunately dont have any benchmarks for TivaC devices at this time. You mentioned in your first post that you tried manipulating the packet size to increase throughput. Can you also try increasing the TCP buffer size and let us know if it helps improve performance ?

    Since this is a TI-RTOS application, I would also recommend disabling logging and asserts to speed things up as well as build the application in release mode.


    Best,
    Ashish

  • Adding to my previous post...

    Do you have a wireshark capture ? If so, could you share that ?

    Thanks,
    Ashish
  • I can create a wireshark dump on Wednesday.

    And I have an other question. I changed the tcpWorker function ot use recvnc instead of recv. My hope was to speed up the echo a little bit.

    Void tcpWorker(UArg arg0, UArg arg1)
    {
        int  clientfd = (int)arg0;
        int  bytesRcvd;
        int  bytesSent;
        char *pBuf;
    
        System_printf("tcpWorker: start clientfd = 0x%x\n", clientfd);
    
        HANDLE hBuffer;
    
        while ((bytesRcvd = recvnc(clientfd, (void**) &pBuf, 0, &hBuffer)) > 0) {
        	bytesSent = send(clientfd, pBuf, bytesRcvd, 0);
            if (bytesSent < 0 || bytesSent != bytesRcvd) {
                System_printf("Error: send failed.\n");
                break;
            }
            recvncfree(hBuffer);
        }
        System_printf("tcpWorker stop clientfd = 0x%x\n", clientfd);
    
        close(clientfd);
    }

    But I keep getting this error:

    "../tcpEcho.c", line 78: warning #225-D: function "recvnc" declared implicitly
    "../tcpEcho.c", line 84: warning #225-D: function "recvncfree" declared implicitly

    The functions 'recv', 'send', 'recvnc' and 'recvncfree' are defined in 'tirtos_tivac_2_14_04_31/products/ndk_2_24_03_35/packages/ti/ndk/inc/socket.h'. So why is 'recv' working but 'recvnc' is not. Is there something I did forget?

  • Yes, that is quite strange. Does the app link fine ? Can you share the full build log ?

    Best,
    Ashish
  • This is the complete build log after a clean build.

    **** Clean-only build of configuration Debug for project tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT ****
    
    /home/nicolas/programme/css/ccsv6/utils/bin/gmake -k clean 
    cleaning ../src/sysbios ...
    rm -rf  "../src/makefile.libs" "tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT.out"  "configPkg/linker.cmd" "configPkg/compiler.opt"  "tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT.hex" 
    rm -rf  "configPkg/" 
    rm -rf "EK_TM4C1294XL.pp" "tcpEcho.pp" "tcpEchoHooks.pp" 
    rm -rf "EK_TM4C1294XL.obj" "tcpEcho.obj" "tcpEchoHooks.obj" 
    Finished clean
     
    
    **** Build Finished ****
    
    **** Build of configuration Debug for project tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT ****
    
    /home/nicolas/programme/css/ccsv6/utils/bin/gmake -k all 
    Building file: ../tcpEcho.cfg
    Invoking: XDCtools
    "/home/nicolas/programme/css/xdctools_3_31_01_33_core/xs" --xdcpath="/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/packages;/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/bios_6_42_03_35/packages;/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/ndk_2_24_03_35/packages;/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/uia_2_00_02_39/packages;/home/nicolas/programme/css/ccsv6/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.M4F -p ti.platforms.tiva:TM4C1294NCPDT -r release -c "/home/nicolas/programme/css/ccsv6/tools/compiler/ti-cgt-arm_5.2.6" --compileOptions "-mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -O0 --opt_for_speed=5 --include_path=\"/home/nicolas/programme/css/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/include\" --include_path=\"/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/ndk_2_24_03_35/packages/ti/ndk/inc/bsd\" --include_path=\"/home/nicolas/Dokumente/workspace_arm/tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT\" --include_path=\"/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/TivaWare_C_Series-2.1.1.71b\" --include_path=\"/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/packages/ti/drivers/wifi/cc3100/Simplelink\" --include_path=\"/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/packages/ti/drivers/wifi/cc3100/Simplelink/Include\" -g --gcc --define=ccs=\"ccs\" --define=PART_TM4C1294NCPDT --define=ccs --define=TIVAWARE --display_error_number --diag_warning=225 --diag_warning=255 --diag_wrap=off --gen_func_subsections=on  " "../tcpEcho.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring tcpEcho.xem4f from package/cfg/tcpEcho_pem4f.cfg ...
    generating custom ti.sysbios library makefile ... 
    Starting build of library sources ...
    making /home/nicolas/Dokumente/workspace_arm/tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT/src/sysbios/sysbios.aem4f ...
    gmake[1]: Verzeichnis »/home/nicolas/Dokumente/workspace_arm/tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT/src/sysbios« wird betreten
    clem4f /home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/bios_6_42_03_35/packages/ti/sysbios/BIOS.c ...
    asmem4f /home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/bios_6_42_03_35/packages/ti/sysbios/family/arm/m3/Hwi_asm.sv7M ...
    asmem4f /home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/bios_6_42_03_35/packages/ti/sysbios/family/arm/m3/Hwi_asm_switch.sv7M ...
    asmem4f /home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/bios_6_42_03_35/packages/ti/sysbios/family/arm/m3/IntrinsicsSupport_asm.sv7M ...
    asmem4f /home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/bios_6_42_03_35/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]: Verzeichnis »/home/nicolas/Dokumente/workspace_arm/tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT/src/sysbios« wird verlassen
    Build of libraries done.
    clem4f package/cfg/tcpEcho_pem4f.c ...
    Finished building: ../tcpEcho.cfg
     
    making ../src/sysbios/sysbios.aem4f ...
    gmake[1]: Verzeichnis »/home/nicolas/Dokumente/workspace_arm/tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT/src/sysbios« wird betreten
    gmake[1]: Für das Ziel »all« ist nichts zu tun.
    gmake[1]: Verzeichnis »/home/nicolas/Dokumente/workspace_arm/tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT/src/sysbios« wird verlassen
    Building file: ../EK_TM4C1294XL.c
    Invoking: ARM Compiler
    "/home/nicolas/programme/css/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -O0 --opt_for_speed=5 --include_path="/home/nicolas/programme/css/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/include" --include_path="/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/ndk_2_24_03_35/packages/ti/ndk/inc/bsd" --include_path="/home/nicolas/Dokumente/workspace_arm/tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT" --include_path="/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/TivaWare_C_Series-2.1.1.71b" --include_path="/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/packages/ti/drivers/wifi/cc3100/Simplelink" --include_path="/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/packages/ti/drivers/wifi/cc3100/Simplelink/Include" -g --gcc --define=ccs="ccs" --define=PART_TM4C1294NCPDT --define=ccs --define=TIVAWARE --display_error_number --diag_warning=225 --diag_warning=255 --diag_wrap=off --gen_func_subsections=on --preproc_with_compile --preproc_dependency="EK_TM4C1294XL.pp" --cmd_file="configPkg/compiler.opt" "../EK_TM4C1294XL.c"
    Finished building: ../EK_TM4C1294XL.c
     
    Building file: ../tcpEcho.c
    Invoking: ARM Compiler
    "/home/nicolas/programme/css/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -O0 --opt_for_speed=5 --include_path="/home/nicolas/programme/css/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/include" --include_path="/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/ndk_2_24_03_35/packages/ti/ndk/inc/bsd" --include_path="/home/nicolas/Dokumente/workspace_arm/tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT" --include_path="/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/TivaWare_C_Series-2.1.1.71b" --include_path="/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/packages/ti/drivers/wifi/cc3100/Simplelink" --include_path="/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/packages/ti/drivers/wifi/cc3100/Simplelink/Include" -g --gcc --define=ccs="ccs" --define=PART_TM4C1294NCPDT --define=ccs --define=TIVAWARE --display_error_number --diag_warning=225 --diag_warning=255 --diag_wrap=off --gen_func_subsections=on --preproc_with_compile --preproc_dependency="tcpEcho.pp" --cmd_file="configPkg/compiler.opt" "../tcpEcho.c"
    "../tcpEcho.c", line 78: warning #225-D: function "recvnc" declared implicitly
    "../tcpEcho.c", line 84: warning #225-D: function "recvncfree" declared implicitly
    Finished building: ../tcpEcho.c
     
    Building file: ../tcpEchoHooks.c
    Invoking: ARM Compiler
    "/home/nicolas/programme/css/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -O0 --opt_for_speed=5 --include_path="/home/nicolas/programme/css/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/include" --include_path="/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/ndk_2_24_03_35/packages/ti/ndk/inc/bsd" --include_path="/home/nicolas/Dokumente/workspace_arm/tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT" --include_path="/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/TivaWare_C_Series-2.1.1.71b" --include_path="/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/packages/ti/drivers/wifi/cc3100/Simplelink" --include_path="/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/packages/ti/drivers/wifi/cc3100/Simplelink/Include" -g --gcc --define=ccs="ccs" --define=PART_TM4C1294NCPDT --define=ccs --define=TIVAWARE --display_error_number --diag_warning=225 --diag_warning=255 --diag_wrap=off --gen_func_subsections=on --preproc_with_compile --preproc_dependency="tcpEchoHooks.pp" --cmd_file="configPkg/compiler.opt" "../tcpEchoHooks.c"
    Finished building: ../tcpEchoHooks.c
     
    Building target: tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT.out
    Invoking: ARM Linker
    "/home/nicolas/programme/css/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -O0 --opt_for_speed=5 -g --gcc --define=ccs="ccs" --define=PART_TM4C1294NCPDT --define=ccs --define=TIVAWARE --display_error_number --diag_warning=225 --diag_warning=255 --diag_wrap=off --gen_func_subsections=on -z -m"tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT.map" --heap_size=8192 --stack_size=4096 -i"/home/nicolas/programme/css/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/lib" -i"/home/nicolas/programme/css/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --xml_link_info="tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT_linkInfo.xml" --rom_model -o "tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT.out" "./EK_TM4C1294XL.obj" "./tcpEcho.obj" "./tcpEchoHooks.obj" "../EK_TM4C1294XL.cmd" -l"configPkg/linker.cmd" -l"libc.a" -l"/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/TivaWare_C_Series-2.1.1.71b/grlib/ccs/Debug/grlib.lib" -l"/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/TivaWare_C_Series-2.1.1.71b/usblib/ccs/Debug/usblib.lib" -l"/home/nicolas/programme/css/tirtos_tivac_2_14_04_31/products/TivaWare_C_Series-2.1.1.71b/driverlib/ccs/Debug/driverlib.lib" 
    <Linking>
    
     undefined  first referenced
      symbol        in file     
     ---------  ----------------
     recvnc     ./tcpEcho.obj   
     recvncfree ./tcpEcho.obj   
    
    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT.out" not built
    
    >> Compilation failure
    gmake: *** [tcpEcho_EK_TM4C1294XL_TI_TivaTM4C1294NCPDT.out] Fehler 1
    gmake: Das Target »all« wurde wegen Fehlern nicht aktualisiert.
    
    **** Build Finished ****

    And here you can find the project exported from CCS: freakscorner.de/.../8oypVYVebIullfW

  • Hi Nicolas,

    Your application's source (tcpEcho.c) is pulling in "sys/socket.h" which is a BSD socket header file (ndk_2_24_03_35/packages/ti/ndk/inc/bsd/sys/socket.h) and does not include the NDK specific recvnc and recvncfree routines. You can call NDK_recvnc()/NDK_recvncfree() APIs instead of recvnc()/recvncfree() to workaround this problem.

    Best,
    Ashish