Importing Code Example into ModusToolbox IDE - KBA225201

Version 15

    Author: JamesT_21     Version: *F

     

    Translation - Japanese: ModusToolbox IDE でサンプルコードをインポートする方法 - Community Translated (JA)

     

    Note: This KBA is for ModusToolbox 2.0 only. For ModusToolbox 2.1, see the ModusToolbox Quickstart Guide, Create New Application.

    Question:

    How do I import a code example for ModusToolbox™ software?

     

    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.