SPRACT8 September   2020 66AK2H06 , 66AK2H12 , 66AK2H14

 

  1.   Abstract
  2.   Trademarks
  3. 1Introduction
    1. 1.1 TI Processor SDK RTOS
    2. 1.2 TI NDK
    3. 1.3 66AK2H Device
    4. 1.4 FTP Offering in TI Processor SDK RTOS
  4. 2Hardware and Software
  5. 3Develop the FTP Server on K2H
    1. 3.1 Reference FTP Server Example
    2. 3.2 Create K2H FTP Server Example
    3. 3.3 Test K2H FTP Server Example
  6. 4Performance Tuning
    1. 4.1 Quick Code Check
      1. 4.1.1 FTP Transmitting Code Check
      2. 4.1.2 FTP Receiving Code Check
      3. 4.1.3 CCS Project Optimization
    2. 4.2 Increase the TCP Buffer Sizes
    3. 4.3 UIA CPU Load Instrumentation
    4. 4.4 What Can We Do on the PC Side?
      1. 4.4.1 TCP Window Scaling Check
      2. 4.4.2 Receive Interrupt Coalescing Check
    5. 4.5 What Else Can We Do on the K2H Side?
      1. 4.5.1 TCP/IP Checksum Offloading Check
      2. 4.5.2 NIMU Driver Efficiency Profiling
      3. 4.5.3 Receive Interrupt Coalescing
    6. 4.6 Final FTP Throughput Results
  7. 5Summary
  8. 6References

Create K2H FTP Server Example

The K2G device has a FTP server example and a basic hello world example, while the K2H device only has the latter. One may compare the two K2G projects for differences, then apply those to the K2H using the hello world example as the template. The note illustrates the steps on how to create the Arm A15 project. The same applies to the C66x project.

As shown below between two .txt files for K2G:

  • NIMU_INSTALL_DIR\example\helloWorld\k2g\armv7\bios\NIMU_BasicExample_evmK2G_armExampleproject.txt
GUID-20200819-CA0I-06G3-GXBW-WCTQGHPFRDSK-low.png Figure 3-1 K2G Hello World Project File
  • NIMU_INSTALL_DIR\example\ftpApp\k2g\armv7\bios\NIMU_FtpExample_evmK2G_armExampleproject.txt
GUID-20200819-CA0I-4JNM-3QN7-T8M5BFT1NJJX-low.png Figure 3-2 K2G FTP Server Project File

It is evident that:

  • The main source files are different
  • The FTP server example has three FTP related source files under ftpserver folder, replacing the udpHello.c for the hello world example.
  • The pre-defined symbols are different: -DNIMU_FTP_APP is an addition to the FTP server example .

Keeping those differences in mind, one can create a FTP example project file for K2H, NIMU_INSTALL_DIR\example\ftpApp\k2h\armv7\bios\NIMU_FtpExample_EVMK2H_armExampleProject.txt, using NIMU_INSTALL_DIR\example\helloWorld\k2h\armv7\bios\NIMU_emacExample_EVMK2H_armBiosExampleProject.txt as the template. The text file shall have the following contents:

-ccs.linkFile "PDK_INSTALL_PATH/ti/transport/ndk/nimu/example/src/main_k2h.c" 
-ccs.linkFile "PDK_INSTALL_PATH/ti/transport/ndk/nimu/example/ftpApp/ftpserver/ftp_commands.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/transport/ndk/nimu/example/ftpApp/ftpserver/ftp_filerout.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/transport/ndk/nimu/example/ftpApp/ftpserver/ftpserver.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/transport/ndk/nimu/example/helloWorld/src/nimu_osal.c" 
-ccs.linkFile "PDK_INSTALL_PATH/ti/transport/ndk/nimu/example/helloWorld/src/nimu_cppi_qmss_iface.c" 
-ccs.linkFile "PDK_INSTALL_PATH/ti/transport/ndk/nimu/example/helloWorld/src/nimu_pa_iface.c" 
-ccs.linkFile "PDK_INSTALL_PATH/ti/transport/ndk/nimu/example/helloWorld/src/setuprm.c" 
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/device/k2h/policy_dsp-only.c" 
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/device/k2h/policy_dsp_arm.c" 
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/device/k2h/global-resource-list.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/transport/ndk/nimu/example/helloWorld/k2h/armv7/bios/helloWorld_ftp.cfg" 
-ccs.setLinkerOptions " -lrdimon -lgcc -lm -lnosys -l:os.aa15fg -nostartfiles -static -Wl,--gc-sections -L${NDK_INSTALL_DIR}/packages/ti/ndk/os/lib"
-ccs.setCompilerOptions "-c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -DSOC_K2H -DDEVICE_K2H -DNIMU_FTP_APP -D_LITTLE_ENDIAN=1 -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH} -I{NDK_INSTALL_DIR}/packages"  -rtsc.enableRtsc

where:

  • main_k2h.c is updated from the helloword.c, the major change is that it calls ftpserver_init() instead of DaemonNew()inside NetworkOpen()
  • helloWorld_ftp.cfg is a duplicate copy of helloWorld.cfg for further modification as will be seen later

Then, the CCS project can be created by: pdkProjectCreate K2H all little nimu all arm.

GUID-20200819-CA0I-ZZB5-09HT-F7PPJNP9JPFJ-low.png Figure 3-3 K2H FTP Server Project Creation With Script

Finally, one can import the project into CCS and build:

GUID-20200819-CA0I-VC0W-LPVC-SWMXZNG3SPQX-low.png Figure 3-4 K2H FTP Server CCS Project
Note: The FTP server source codes include header files from <ti/fs/fatfs/ff.h>. However the PDK K2H package doesn’t contain them. One can copy those from PDK package for other devices like K2G or clone from TI GIT repository: https://git.ti.com/cgit/keystone-rtos/fatfs/tree/. Three files are needed under pdk_k2hk_4_0_xx\packages\ti\fs\fatfs folder: ff.h, ffconf.h and integer.h.