SPRACM5 April   2019 AM3351 , AM3351 , AM3352 , AM3352 , AM3354 , AM3354 , AM3356 , AM3356 , AM3357 , AM3357 , AM3358 , AM3358 , AM3359 , AM3359

 

  1.   How to Port WOLFSSL Onto TI Sitara AM335 Starterkit
    1.     Trademarks
    2. 1  Introduction
    3. 2  Hardware and Software Required Stuffs
    4. 3  Step-by-Step Porting
    5. 4  Merging the WolfSSL Code and Building Regarding the NIMP FTP Example
    6. 5  How to Verify?
    7. 6  Testing environment
    8. 7  Demo Movie
    9. 8  Function API
    10. 9  Test Pass Logs
    11. 10 References

Merging the WolfSSL Code and Building Regarding the NIMP FTP Example

Create the three sub-folders (see Figure 1) in your code base, then put those folders under the parent folder named: wolfSSL.

figure-spracm5.gifFigure 1. Project Arch to Create Three Subfolders for wolfSSL
  1. Copy wolfssl-master\src to (for example):
  2. If you are installing all of the TI packages, then, go to pdk_am335x_1_0_10\packages\MyExampleProjects\NIMU_FtpExample_skAM335x_armExampleproject\wolfssl\src.

    figure-01-spracm5.gifFigure 2. Copy wolfssl\src
  3. Copy wolfssl-master\wolfcrypt\src to (for example):
    • If you are installing all of the TI packages, then, go to pdk_am335x_1_0_10\packages\MyExampleProjects\NIMU_FtpExample_skAM335x_armExampleproject\wolfssl\wolfcrypt\src.

      fig2_spracm5.gifFigure 3. Copy wolfssl\wolfcrypt\src

      Do not copy the “port” dir.

      Do not copy the .asm .s file.

      Figure 4 is marked with “X”.

      fig3_spracm5.gifFigure 4. Ignore the .s/.asm Files
    • Copy the wolfssl-master\wolfssl\ files to (for example):
    • If you are installing all the TI packgeI, then, go to pdk_am335x_1_0_10\packages\MyExampleProjects\ NIMU_FtpExample_skAM335x_armExampleproject\wolfssl\wolfSSL.

      fig3_spracm5.gifFigure 5. Copy wolfssl\wolfSSL
    • Copy the wolfssl-master\wolfssl\wolfcrypt code (without “port” folder”) to (for example):
    • If you are installing all the TI packge, then, go to pdk_am335x_1_0_10\packages\MyExampleProjects\NIMU_FtpExample_skAM335x_armExampleproject\wolfssl\wolfSSL\wolfcrypt.

      fig5_spracm5.gifFigure 6. Copy wolfssl\wolfSSL\wolfcrypt
    • Modify some codes:
    • In the wolfssl\wolfcrypt\src\random.c, add the code as shown in Figure 7.

      fig6_spracm5.gifFigure 7. random.c Modification
    • In the wolfssl\src\internal.c, add the code as shown in Figure 8.
    • fig7_spracm5.gifFigure 8. internal.c Modification

      Add a new file (for example):

      • wolfssl\src\random_rng_Porting.c

      Reference the random_rng_Porting.c file in this zip file: 2018_5_15_WolfSSL_Importan_Temp_Backup_Client_Server_All_Okay_Release.

      Download from here.

      fig8_spracm5.gifFigure 9. random_rng_Porting.c Modification
    • Add the two parts shown in Figure 10 into the file: nimu_skam335x.cfg.
    • fig9_spracm5.gifFigure 10. nimu_skam335x.cfg Modification
    • In the wolfssl\src\internal.c file, add the two parts:
    • The first part is to register the user I/O call back:

      • wolfSSL_SetIORecv
      • wolfSSL_SetIOSend

      figure-10-spracm5.gifFigure 11. My Own IO Callback Regs

      Another one is to get the system time, this is related with the NO_ASN_TIME/ASN_TIME config.

      figure-11-spracm5.gifFigure 12. My Time Modification
    • Add the “must-have” compile options for wolfSSL.
    • For example, xNO_FILESYSTEM is to disable the “NO_FILESYSTEM”.

      figure-12-spracm5.gifFigure 13. Compile Definition

      Add the included folder for the wolfSSL used header file.

      figure-13-spracm5.gifFigure 14. Include Path Setting Part 1
    • Add the Variables for environment including use.
    • figure-14-spracm5.gifFigure 15. Include Path Setting Part 2
    • Adding the variable to the environment.
    • figure-15-spracm5.gifFigure 16. Include Path Setting Part 3
    • Project settings:
    • Select the right compiler version and the boards. AM335SK can use the ICE_AM3359.

      figure-16-spracm5.gifFigure 17. Project Setting
    • Product settings:
    • Please make sure the right versions of:

      • XDCtools
      • SysBios
      • PDK
      • NDK

      figure-17-spracm5.gifFigure 18. Product Setting
    • Target config:
    • The important key for the download image and debug is the JTAG.

      • It needs to choose XDS100V2 USB
      • Board of device is: SK_AM3358

      You can test the connection while finishing your own setting of the “ccxml.

      figure-18-spracm5.gifFigure 19. Target Config
    • Build should be successful.
    • figure-19-spracm5.gifFigure 20. Project Building