Importing Code Example into ModusToolbox IDE - KBA225201

Version 8

    Author: JimT_21     Version: *D

     

    This document applies to ModusToolbox IDE v2.0. For ModusToolbox 1.1, the instructions are different. To see an earlier version of this document you must be logged in to the Community. Then:

    • Click the Version identifier toward the top right of the document.

    • In the comparison window that appears, on the left, pick the version you want to look at. You can ignore the rendering of differences on the right hand side.

    • Refer to version 7 of the document for ModusToolbox 1.1.

     

    Question:

    How do I import a code example into ModusToolbox™ IDE?

     

    Answer:

    You can create a code example for either the ModusToolbox integrated development environment (IDE), or for a third-party IDE. This knowledge base article applies to ModusToolbox 2.0 code examples found at the Cypress GitHub repository. Examples are designed to support one or more kits. Note that the example is on GitHub. A network connection is required to create a code example. The screenshots in this article use the Windows-hosted tools. The same tools are available on macOS and Linux.

     

    For ModusToolbox IDE

    In ModusToolbox IDE, in the Quick Panel, click New Application.

     

    You can also use a menu command,
    File > New > ModusToolbox IDE Application.

    Select your kit and click Next. The code example you want to create must support the kit you select in this step.

    Pick the starter application (code example) you want to create. You can change the application name, if required.

     

    Click Next to see a summary of your choices..

    Click Finish to create the application.

    The application appears in the Project Explorer. The required resources and source files are downloaded from GitHub, so this may take some time.

     

    The downloaded library files (for example, the Peripheral Driver Library or the CapSense library) are in the libs folder in the project. The readme.md file describes the example and how to use it.

    For a Third-Party IDE

     

    The Project Creator tool serves the same purpose as the ModusToolbox IDE’s New Application wizard. The tool is located here: <ModusToolbox install>/tools_n.n/project-creator/.

     

    Launch the Project Creator tool.

    The tool gets the required manifests that define available examples. Click Next.

     

     

    Select your kit and click Next. The code example you want to create must support the kit you select in this step.

    Pick the starter application (code example) you want to create. You can change the application name, if required.


    Specify the location where you want the example code to appear. Ensure there is no space in the file path.


    Click Next to see a summary of your choices.

    Click Create to create the application.
    All the code required for the application (including dependent libraries) appears in a folder with the application name, at the location you specified in the previous step. This can take some time. All dependent libraries are copied locally and appear in the libs folder. You can then add these source files to your IDE’s project.