Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

Importing Code Example into ModusToolbox IDE

Importing Code Example into ModusToolbox IDE

JamesT_21
Moderator
Moderator
Moderator
10 solutions authored 5 solutions authored First solution authored

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

How to import a code example for ModusToolbox™ software?

 

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 Infineon 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.

pastedImage_7.png

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

pastedImage_0.png

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..

pastedImage_6.png
Click Finish to create the application. pastedImage_0.png

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.
pastedImage_0.png

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

pastedImage_19.png

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.

pastedImage_20.png
Click Create to create the application. pastedImage_22.png
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. pastedImage_24.png
4123 Views