PEmicro-erlebniswelt

A2B Bus

The Cyclone Control Console is a powerful command line application that can be used to control one or more Cyclones simultaneously. Programming images can be added/removed, settings read/set, programming operations started and dynamic data programmed. The command line application displays comprehensive status messages and also returns an error code indicating success or failure. The application can be started from a script, a console or another application. It is one of the three main components of the Cyclone Control Suite, including: the Cyclone Control Console, the Cyclone Control GUI, and the Cyclone Control SDK.

This blog post demonstrates many common Cyclone programming operations that can be easily performed using the Cyclone Control Console application.

The Cyclone User Guide contains information on various command line parameters available on the Cyclone. The Cyclone Control Console can also display a condensed list of available parameters using the -help command line parameter.

 

List of available command line parameters of Cyclone Control Console

The current list of commands can always be obtained from the console application using the -help command line parameter. Available options are displayed:

1

 

Examples of cyclone compounds
 

List of auto-detected Cyclones

Cyclones can be connected to the PC via USB, Ethernet and serial interfaces. Cyclones connected via USB and Ethernet connections may be automatically detected. With Ethernet, only Cyclones on the local subnet are autodiscovered (remote Cyclones can be controlled from the console but cannot be autodiscovered). The Cyclone's name, IP, and port number are listed. Any of these identifiers can be used to open a Cyclone. The name and IP address are recommended for opening a Cyclone as the port number may change depending on the number of Cyclones connected.

In this example, three Cyclones are detected, with each Cyclone connected to the PC via USB and Ethernet connections.

2

Note: If a Cyclone is connected via both USB and Ethernet, it will be listed twice.

 

Opening a Cyclone by name (and listing images)

Opening a Cyclone by name is the most common way to specify a Cyclone. It works regardless of whether it is connected via USB or Ethernet. The selected identifier is specified by the command line parameter -cyclone = [identifier], where [identifier] is the Cyclone's name, IP, or port. Most command line operations (such as start programming) use the -cyclone parameter to specify the cyclones to open, and then add other parameters to specify which functions to perform. Multiple Cyclones can be specified in a comma separated list or using command line parameters with multiple Cyclones.

In this example, we also have a command line parameter -listimages, which specifies that the utility should display the list of images that are located in both the internal and external storage of the specified Cyclone.

Here is an example of opening the Cyclone "Ada" by name and listing the images it contains.

3

The programming images are listed by number. Each image also states "eSAP" if the image is encrypted, or "SAP" if the image is not encrypted. The image location is also referred to as "Internal" for images stored in the Cyclone's internal memory, or "External" for images stored on an SD memory card in the Cyclone's SDHC port (Cyclone FX or SDHC port activation license required (LC models). Finally, the image description is listed (this may differ from the file name).

Note: A Cyclone's name can be found on the LCD touch screen or on one of the components of the Cyclone Control Suite (GUI, Console and SDK). Once the name is set, it is stored in the Cyclone's non-volatile memory and is retained until changed. Other ways to open a Cyclone are by IP address or port number.

 

Opening a Cyclone by port (and listing images)

In addition to the name and IP number, a cyclone can be specified by the port name. This can be useful when there is only one Cyclone connected to the USB/Ethernet buses, or when the Cyclone is connected via a COM port. To open a Cyclone connected to a specific COM port, use the corresponding COM port number (COM1...COM8). Use USB1 (USB ports range from USB1..USB39) to open the first detected USB Cyclone. To open the first Ethernet cyclone, use Ethernet1 (Ethernet ports range from Ethernet1..Ethernet99). Note that the Cyclones are listed in a sorted order to determine the port number. Therefore, the port numbers may change with the number of Cyclones detected. Because of this, we recommend using the Cyclone name or IP address to specify the appropriate Cyclones when using multiple Cyclones at the same time. However, when using a single Cyclone, the port number can be an easy way to open a Cyclone connected to the PC without knowing its IP address or name.

An example of opening the first Cyclone detected on the USB bus:

Below is an example of opening a Cyclone by its IP address. The Cyclone can be mounted remotely from the PC. In this case the Cyclone's IP address, gateway address and netmask should be set correctly for the network it is connected to. Example of opening by IP address:

 

Open multiple Cyclones (and list images)

Opening multiple Cyclones is easy. Either pass a comma-separated list of cyclone names to the -cyclone= parameter (e.g. -cyclone = ada, colossus, hal9000) or use multiple -cyclone parameters (e.g. -cyclone = ada - cyclone = colossus -cyclone = hal9000). . The other operations on the command line are performed on all opened Cyclones, including starting the program, with the exception of dynamic data programming (where the Cyclone to apply the dynamic data to is specified as part of the parameter). Here is an example of listing images on two Cyclones:

Image management examples (add/remove)

Adding a programming image to a Cyclone


Images can be added to a Cyclone by using the -addimageinternal = command line parameter and specifying the filename of the programming image to add. Multiple Cyclones and multiple images can be specified on the same command line. In this example we add a single Image to a single Cyclone:


6

Note that you can load an encrypted programming image (eSAP file) onto a Cyclone only if the ImageKey associated with that encrypted image is on the Cyclone. For more information, see the Encrypted SAP Images section.

 

Removing a programming image from a Cyclone


Certain images can be removed from a Cyclone by number, description or condensed description. A condensed description is the image description with all spaces removed (making it easier to use command line parameters when the description contains spaces). The specified identifier is not case-sensitive. The HAL9000 Cyclone in this example currently has the following programming images:

 

Image on Cyclone HAL9000

   Image 1 (SAP internal): Red Image v1.0

   Image 2 (SAP internal): Green Image v1.0

   Image 3 (SAP internal): Bl ue Image v1.0

   Image 4 (SAP internal): Red image barcode v1.0

   Image 5 (SAP internal): Green Image Barcode v1.0

   Image 6 (SAP internal): Blue Image Barcode v1.0

   Image 7 (SAP internal): Run Test Application v1.02

   Image 8 (SAP internal): Green

 

In the following example, we remove an image based on its full description (including spaces). Because this example is running on Windows, we surround a parameter with double quotes to indicate that it is a parameter even though it contains spaces:


7

In the following example, we remove an image based on its compressed description. This works on all operating systems, although the actual description contains spaces (we omit them on the command line). For this reason, we recommend using condensed descriptions. Note that quotation marks are not required in this example:


8

 

In the following example, we remove an image by its number:


9

 

Note that deleting images changes the image numbers. If there are 5 images and image 4 is deleted, image 5 becomes image 4.

 

 

Delete all images in a Cyclone


There are two command line parameters that you can use to delete groups of images in the Cyclone so you don't have to remove them one by one:

 

    -eraseallinternalimages: Erases all internal images from open Cyclone

    -eraseallexternalimages: Erases all external images from open Cyclone

 

Internal imageas reside in the Cyclone’s encrypted internal storage, while external images reside on an encrypted SDCard that is optionally attached to the Cyclone. Images can be deleted from multiple Cyclones by specifying more than one Cyclone on the command line. In this example we delete all images that are internal to the HAL9000 Cyclone:


10

 

Add multiple images to multiple Cyclones


The following is an example of combining different image management techniques. We open two Cyclones (Agnes and Colossus), delete all internal images and then add six programming images to each Cyclone, all with one command:


11

 

 

Examples for programming starts

Launching a programming image on a Cyclone


Images in the Cyclone can be selected and launched by specifying either the image number in the Cyclone, the image description, or the compressed version of the image description (with spaces removed).

This example shows how to start programming an image specified in its compressed description:


12

 

This example shows how to start programming an image specified by the image number in the Cyclone:


13

 

Note that programming for an encrypted (eSAP) image will not start if the ImageKey for that file has been removed from the Cyclone. For more information, see the Encrypted SAP Images section.

Starting the same image on different Cyclones at the same time, selected by name
The same image can be started on multiple Cyclones at the same time simply by specifying multiple Cyclones on the command line. If on any Cyclone If there are different sets of images, using the compressed image descriptions is a good way to ensure that the appropriate programming image is booted. If the image set on each Cyclone is the same, then the image number will match. So the image number is another way to launch the same image on multiple Cyclones. In this example, the compressed image description is used to start programming:


14

 

Launch different images at the same time on different Cyclones, selected by number

Sometimes there are multiple microcontrollers on a board that need to be programmed at the same time. It is often advantageous to use multiple Cyclones, each programming a different image at the same time. The approach is to ensure that each Cyclone is loaded with a different image, so it has the same number in each Cyclone. A simple way to do this is to delete all images in both Cyclones and then add a different image to each Cyclone. In this case, Image 1 would be different in each Cyclone, but could be started at the same time:


15

 

Programming dynamic data after image programming

In addition to programming the data specified as part of a programming image, additional data may be programmed into each target device. This data can be specified each time a programming image is started, and as such can be customized target by target. Dynamic data has many use cases: customer-driven serialization, configuration, tracking, date encoding, etc. Multiple sets of dynamic data can be specified on the command line. Data can be provided as an array of bytes or as a null-terminated string.

 

The cyclone handle number must be specified as part of the dynamic data programming parameter. This allows various dynamic data to be programmed into targets associated with each opened Cyclone. If only one Cyclone is started, the value 1 is used. If three Cyclones were specified on the command line, they would be numbered 1, 2, and 3 in left-to-right order on the command line.

 

The syntax for programming dynamic data as an array of bytes is:

 

   -putdynamicdata = [cyclone number], [address], [data]

 

In the following example, we program a user-generated 4-byte serial number array into the target after the main image programming is complete:


16

 

Note: When programming dynamic data, image programming must first be started on this command line.

 

The syntax for programming dynamic data as a null-terminated string is:

 

    -putdynamicstring = [cyclone number], [address], [string]

 

In the following example, we program a user-generated IP address string into the target after the main image programming is complete:


17

 

Note: Image programming must be started as part of the command line when programming dynamic data. The examples provided are for customer generated serial numbers and IP strings. The Cyclone also supports automatic counting of serial numbers to be saved as part of the image.

 

Programming different dynamic data into multiple targets from different Cyclones


In the following example, we program both a unique user-generated serial number and a unique user-generated IP address string into two different targets connected to two different Cyclones:

 


18

 

Note: Image programming must be saved as part of the command line when programming dynamic data. The examples provided are for customer generated serial numbers and IP strings. The Cyclone also supports automatic counting of serial numbers stored as part of the image.

 

Read/write Cyclone/image properties


There are many properties in the Cyclone and its resident image that can be useful for viewing and, in some cases, changing.

 

Retrieving a list of property categories from the Cyclone


Properties are stored in Cyclone in different categories including system settings, network settings, image specific settings and others. A list of the available categories can be displayed using the -showproperties = command line parameter without anything following the equals sign.


19

 

Reading the list of property names/values in a category


In the example below, we show the traits in the “Cyclone Traits” on. This includes the name of the Cyclone and the number of images in the Cyclone. The syntax of the -showproperties command line parameter is:

 

    -showproperties = [category], [image name or #]

 

This will show all of the properties in the category. Leave blank after the = for the entire category list. In this case we can set the image name or image number to 0 or leave it blank since we are not accessing the properties of an image.


20

 

Read image properties such as next serial number and CRC


The properties of the images stored in the Cyclone can be read by clicking on the “Image Properties” access and specify the image name or image number. The syntax of the -showproperties command line parameter is:

 

    -showproperties = [category], [image name or #]

 

This will show all of the properties in the category. Leave blank after the = for the entire category list. In this case we are reading the properties of the "green_serial" image. Notice that information such as the CRC and serial number of the image is displayed:


21

 

The image has a single serial number, which is currently "PE-00b". The next time you start programming, the target with serial number “PE-00b” programmed. As the serial file is incremented by 2, the Cyclone will automatically increment the serial number to 'PE-00d'. This serial number is an example of the Cyclone's ability to automatically count the serial number. PEmicro has a serial number definition utility that allows the user to automatically create counting serial numbers.

 

For demonstration, let's start programming and display the serial number in a single console command. As part of the programming process, “PE-00b” programmed into the target and the serial number stored for the image in “PE-00d” changed:


22

 

Specifying the name of a Cyclone by writing the Cyclone Name property


Some settings in the Cyclone are writable, e.g. B. the network settings and the name of the Cyclone. In this example we are setting the name of the Cyclone. Specifying the name of a Cyclone can be useful because we can use Name to specify a specific Cyclone for other commands. This can be as simple as declaring the device's capability "JuliesCycloneDoNotTouch" or choosing a name that implies a location, e.g. For example, "ProductXFixtureSlot3".

 

Let's start by listing automatically recognized Cyclones:


23

The Cyclone named Ada is on both the USB and Ethernet buses of the PC led. Let's query the Cyclone Properties category of the Cyclone named Ada:


24

 

As expected, the Cyclonename property is Ada. We know this because we have connected to it so much. Let's say we wanted to change the name to Skynet instead. We would use the -setproperty= command to change the value. The syntax of the command is:

 

    -setproperty = [category], [image name or #], [property], [value]

 

Since the name doesn't belong to the "image properties" category, we can set the image number to 0. Here we change the name of Colossus to Skynet:


25

 

Now, if we query the Cyclones found on the USB and Ethernet buses, we can see that the Cyclone name has changed from Ada to Skynet:


26

 

Manage encrypted SAP images


The Cyclone Control Console provides commands to manage encrypted (eSAP) programming images. These commands allow you to list, add, and delete ImageKeys. These are files used to encrypt a programming image. An eSAP image cannot be loaded onto a Cyclone or started for programming after loading unless the ImageKey used to encrypt the eSAP image is on the Cyclone.

Determine the encryption status of a programming image

The -listimages command is used to list the programming images on a specific Cyclone. This image list shows whether each image is encrypted or not. Images listed as "eSAP" are encrypted, images listed as "SAP" are not. The first two programming images listed in the following screen are encrypted.


27

Specific information about the encryption status of an individual programming image can be displayed using the -showproperties=imageproperties command for that particular image. Three values are relevant for image encryption:

1) The imageEncryptionStatus property indicates the encryption status of a programming image as one of three values:

Encrypted. Ready to run.
Encrypted. Blocked - No key found.
Not encrypted. Ready to run
2) The imageKeyDescription property indicates the name of the ImageKey, if any, associated with the programming image.

3) The imageKeyID property indicates the unique ID of the ImageKey, if any, associated with the programming image.

The following screen shows all image characteristics for the "K64 Encrypted BB 16K" image:


28

These properties indicate that the image is encrypted but lacks the ImageKey. The image is therefore locked and cannot be programmed. The ImageKey needed to unlock this image so that it can be programmed is called "Kevin BB" and its ID# is "pei-6D479B42-51D84364-5CA47697".

Using ImageKey Commands
The following uses the image above to demonstrate how to use the Cyclone Control Console's ImageKey commands to determine which ImageKey is missing, load that ImageKey onto the Cyclone so that the image can be programmed, and then deleting the ImageKey again locks the encrypted image .

The console provides commands to list, add, and remove ImageKeys:

-listEncryptionKeys
-addEncryptionKey = [file path]
-deleteEncryptionKey = [object id or display index]


List of ImageKeys

First, the -listEncryptionKeys command shows that there is an ImageKey on the Cyclone (whose display index is 1), but it is not the key named "Kevin BB" that we used for the Need image unlock:


29

Add an ImageKey

The -addEncryptionKey command is then used to add the missing ImageKey to the Cyclone. The file path for the ImageKey is required:


30

The -listEncryptionKeys command now shows that the required ImageKey was added at display index 2:


31

Looking at the image properties again, the encrypted image is now programmable:


32

 

Delete an ImageKey

The user may want to remove this ImageKey later so that the eSAP file "K64 Encrypted BB 16K" cannot be programmed. This is done using the -deleteEncryptionKey command with either the ID of the ImageKey or (as in the example below) the display index of the ImageKey:


33

Listing the ImageKeys again with the -listEncryptionKeys command shows that the ImageKey has been removed.


34

 

For more information on Cyclone image encryption, see the blog post "Cyclone Adds RSA/AES Encryption for Production Programming".

 

Additional Notes / Features


Recovering success/failure results from python/bash/batch/etc.


The Cyclone Control Console not only displays success and failure information as strings written to the console, but also returns a corresponding error code to the operating system on the PC. This error code can be tested in an application or in different scripting languages. A zero error code indicates successful operation and a non-zero error code indicates an error.

 

Here is an example Windows batch file that can be used to successfully recover success/failure information from the Cyclone Control Console:

 

cyclonecontrolconsole -cyclone=Agnes -launchimage=green_serial

If ERRORLEVEL 1 no longer occurred

echo Successfully programmed!

done

:An error has occurred

Echo programming failed!!!!!

:done

 

Here is an example bash shell script that can be used to successfully recover success/failure information from the Cyclone Control Console:

 

#! /bin/bash

cyclonecontrolconsole -cyclone=Agnes -launchimage=green_serial

errorReturn = $?

if [$errorReturn == 0]; then

  Echo 'Successfully programmed!'

other

  echo 'Programming failed !!!!! with the error code '$errorReturn

  Exit 1

fi

 

Here is an example Python script that can be used to successfully recover success/failure information from the Cyclone Control Console:

 

Import Subprocess

Import sys

 

P = subprocess.run ("cyclonecontrolconsole -cyclone = Agnes -launchimage = green_serial", shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE)

print ("Print STDOUT:")

print (P.stdout.decode ())

if P.returncode == 0:

print ("Successfully programmed!")

other:

print ("Programming failed!!! with error code" + str (P.returncode))

sys.exit (1)

 

Order of execution of command line parameters


Command line parameters are all evaluated before being executed. If there is an invalid parameter, the Cyclone Control Console will generate an error and indicate which parameter is not understood. Parameters are executed in a priority order. Multiple parameters with the same priority are executed in the order in which sie displayed in the command line (from left to right). The priorities of the parameters shown in the blog post are (from highest to lowest):

 

 10 Help

 9-Listcyclones

 7-Cyclone

 5 -eraseallinternalimages

 5 -eraseallexternalimages

 5 -eraseimage

 4 -addimageinternal

 4 -addimageextern

 4 list image

 3-Startimage

 2 -putdynamicdata

 2 -putdynamicstring

 2-Set property

 1 -showproperties

 

Cyclone Control Suite - Download and Licensing


The latest Cyclone installation software includes the Cyclone Control Suite. The Cyclone Control Console is one of the components of the Cyclone Control Suite.

 The standard features of the Cyclone Control Suite work with any Cyclone device, regardless of model or date of purchase (no license required).

 The advanced automation capabilities of Cyclone Control Suite require the following:

a Cyclone FX programmer (no license required) or
a Cyclone LC with an advanced automation enablement of Cyclone Control
Encrypted programming images require either:

a Cyclone FX programmer (no license required) or
a Cyclone LC with ProCryption Security enabled
The blog post examples above use a mix of standard and advanced features.

 

Conclusion


The Cyclone Control Console is a command line utility that allows the user to read/set Cyclone settings, add/remove image and image keys, launch image and even add dynamic data from the command line can. It is one of the three powerful components of PEmicro's Cyclone Control Suite, found in both CYCLONE and CYCLONE FX programmers.

Cylone Standalone Programmer

7.08 %
pemicro cyclone fx universalCyclone FX Universal Header Layout
Cyclone Universal FX
CYCLONE-FX-UNIV
The PEmicro Cyclone FX Universal is a standalone programmer for ARM and 8/16/32 bit processors.

€1,300.00* €1,399.00*
pemicro cyclone fx armCyclone FX ARM Header Layout
Cyclone FX ARM
CYCLONE-FX-ARM
The PEmicro Cyclone FX ARM is a standalone programmer for ARM processors and provide advanced safety functions.

€1,199.00*
2 %
PEmicro cyclone lc universalpemicro cyclone lc universal header layout
Cyclone LC Universal
CYCLONE-LC-UNIV
The PEmicro Cyclone LC Universal (U-Cyclone) is a standalone programmer for ARM and 8/16/32 bit processors.

€979.00* €999.00*