• Menu
  • Product
  • Email
  • PDF
  • Order now
  • How to Port WOLFSSL Onto TI Sitara AM335 Starterkit

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

       

  • CONTENTS
  • SEARCH
  • How to Port WOLFSSL Onto TI Sitara AM335 Starterkit
  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
  2. IMPORTANT NOTICE
search No matches found.
  • Full reading width
    • Full reading width
    • Comfortable reading width
    • Expanded reading width
  • Card for each section
  • Card with all content

 

APPLICATION NOTE

How to Port WOLFSSL Onto TI Sitara AM335 Starterkit

How to Port WOLFSSL Onto TI Sitara AM335 Starterkit

This application report introduces how to integrate the wolfSSL onto TI Sitara RTOS.

Project collateral discussed in this application report can be downloaded from the following URL: http://www.ti.com/lit/zip/spracm5.

Trademarks

All other trademarks are the property of their respective owners.

1 Introduction

WolfSSL is a famous TLS/SSL software solution and it is proven by many worldwide customers. Its quality is robust and the WolfSSL company maintains the security of their product each year.

This document contains:

  • Where to get the right WolfSSL code versions
  • Which TI RTOS version will be the suitable base for porting
  • Step-by-step porting
  • Code building
  • How to run the demo

2 Hardware and Software Required Stuffs

  • Hardware:
    • TI AM335 Starter Kit
  • Software:
    • TI RTOS SDK for AM335
  • WolfSSL for TI TivaC:
    • wolfSSL/wolfssl-examples
  • WolfSSL main release
  • TI CCS 7.4
    • Download CCS
  • Microsoft Virtual Studio Express 2012
    • en_visual_studio_express_2012_for_windows_desktop_x86_web_installer_1001991.exe

3 Step-by-Step Porting

Follow these steps for porting:

  1. Download the AM335 RTOS SDK.
  2. Create the example by referencing this: http://processors.wiki.ti.com/index.php/Rebuilding_The_PDK
  3. Build the PDK.
  4. Follow the information in Section 4 to merge the WolfSSL required code.
  5. The pictures in Section 4 have the WolfSSL original code.
  6. Add the must-have compile option.
  7. Rebuild the entire project.

4 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

    5 How to Verify?

    You can reference this article:

    • USING WOLFSSL WITH VISUAL STUDIO

    You can access the two exe files that are listed under this path: : wolfssl-master\Debug.

    • Client.exe
    • Server.exe
    • Run the WolfSSL Client on the NB to verify your server code (the Server IP/port is depended on the code).
      • Client.exe –h 192.168.1.4 –p 2000
    • Run the WolfSSL Server on the NB to verify your WolfSSL client code (the port is dependent on the code).
      • Server.exe –b –p 1000
    • Use the NB with Win7 and Virtual studio express.
      • en_visual_studio_express_2012_for_windows_desktop_x86_web_installer_1001991.exe

    6 Testing environment

    The testing environment is as shown in Figure 21; each node will communicate with the Ethernet.

    spracm5_fig21.gifFigure 21. Demo Setting

     

    Texas Instruments

    © Copyright 1995-2025 Texas Instruments Incorporated. All rights reserved.
    Submit documentation feedback | IMPORTANT NOTICE | Trademarks | Privacy policy | Cookie policy | Terms of use | Terms of sale