cancel
Showing results for 
Search instead for 
Did you mean: 

ModusToolbox Blog

DheerajK_81
Moderator
Moderator

Using the Project-Creator Command Line Interface (CLI)

Having a GUI makes developing applications more intuitive. The visual feedback and ease of use are really helpful. But, sometimes, I like to use the command line to learn what is happening in the background.

So, this blog will be focusing on what happens when you create projects using the Command Line Interface. I’ll show you things you would never usually think about, to give you a different perspective so that you can learn something new.

We are going to look into the project-creator-cli tool. But before that, there are some things you need to know about ModusToolbox. It uses Cygwin under the hood and all tools are verified to be compatible with *NIX terminal environments. Based on the OS you are using, you need to keep this in mind:

  • All Linux terminal applications are compatible.
  • All macOS terminal applications (including the Apple-provided Terminal App) are compatible.
  • On Windows, you need to run the “Cygwin.bat” script available inside the “tools_2.0\modus-shell” directory. The Windows “Command Prompt” and “Power Shell” aren’t tested/supported/known to be compatible.

Okay, now we are all set. The project-creator-cli tool comes packaged with ModusToolbox and as the name suggests it creates a project.

pastedImage_0.png

This is the first step you will take while creating any ModusToolbox application. Every command-line tool comes with a “--help” (dash dash help) option to provide information on what it can do. I like playing with my toys first and then looking at the user manual. You can refer to the docs folder for usage documentation but I do that only when I get stuck.

So, type in “project-creator-cli.exe --help” to get the list of options. 

pastedImage_1.png

Before I can pass in all the arguments, I need information on what kind of values I can provide. As the help info suggests, I can list the boards and applications using the “--list-boards” and “--list-apps <board>” and I’m going to do just that.

pastedImage_2.png

pastedImage_4.png

Okay great. Now that I have all the information I need, I can pass in the arguments. I’m going to ignore the optional arguments.

>> ./project-creator-cli.exe --board-id CY8CPROTO-062-4343W --app-id mtb-example-psoc6-empty-app

cmd.png

The project will be created in the user profile directory by default as shown in the figure above. The project folder will have the same name as the application name.

pastedImage_7.png

Here is an assignment for you to try over the weekend - Try out the “-d” and “-n” options to create the application in your target directory and to specify the application names respectively.

When you create a new application using the Eclipse IDE, this is exactly what happens in the background. Based on the target and application template selected, it passes them as arguments to the backend process that creates the project. That’s the beauty of the command line. It is hard work, but you understand how things flow. I hope this gave you a new perspective and you learned something new today. Stay tuned for more such content!

PS: This was my first blog. You will see more from me in the coming few weeks. I am planning to write about building and programming an application all from the command line next. Let me know if you would like to add something else as well.

2 Comments
WaMa_286156
Contributor II

I like your blog post, as far as it goes.

Some day, I hope that the visual schematic editor is ported to Mono (a .Net clone, now owned by Microsoft)  from .Net and made part of Microsoft's Visual Studio for Mac.  At that point, using the Cypress Tools on Mac and Linux will be much easier.

At the current time, I am more or less stuck with PSOC Creator.  It is a fine development system.  It is *still* light years ahead of your competition in ease of use.  Its examples *work*.  I can't say that for other development systems from other vendors.

With Visual Studio for Mac, I can see a path for the future, though very clunky.  To be clear, I don't like eclipse, Visual Studio, EWARM, or most of the other tools out there. I *do* like PSOC Creator, and IntelliJ's editor, if run on a powerful enough machine.  However, like Quigley (Quigley Down Under Movie), just because I don't like them, doesn't mean I don't know how to use them.  I have used all of them for projects.

Visual Studio is one of the lesser of the evils out there.

Can you blog on transferring a project from PSOC Creator into Visual Studio?  I have not spent the time to do that, too much work in the pipeline.

Can you write a series of blogs on how to do PSOC Creator style pin assignments either in Code, or in the Modus ToolBox.  I would like to have the same functionality if at all possible.

What makes the PSOC stand out among all other mixed signal MCU's is the ability to route any signal to any pin (with very few exceptions).  This is great for the maker community, and for small production runs.  Hands down the best SOC out there.

0 Likes
DheerajK_81
Moderator
Moderator

I really like all the suggestions. PSoC Creator is not cross-platform and works only on Windows. ModusToolbox solves this problem and is available on Windows, MacOS and Linux. What's interesting is, with the new release, there is support for Visual Studio Code, IAR Embedded Workbench, Keil-MDK and it's all done with the help of a single command.

See here for more information on this: Available Now - ModusToolbox 2.1

I will be writing more blogs to capture other things you have mentioned definitely. Here's the next blog which might interest you further: Build, Program and Debug your ModusToolbox Application using the Command Line Interface (CLI)

Regards,

Dheeraj

0 Likes
Top labels