Automated flash programming with C | Cyclone Control Suite SDK

The PEmicro product line of Cyclone single programmers offers a fast, robust and automated solution for programming microprocessors on a production scale. However, production plants may want an even higher degree of automation than the one-button touch function offered by the Cyclone. PEmicro offers various options for automating the control, including a console application, Ethernet / serial protocol communication or the SDK that is included in the new Cyclone Control Suite from PEmicro. In this article, we discuss using the SDK to automate programming control and the flexibility and scalability that it offers our customers.

NOTE: This example is shown in C. The code and demo applications of the Cyclone Control SDK interfaces are included for GCC, LabView, Microsoft Visual C, Microsoft Visual C # and Delphi / FPC.


1. Introduction - control of a cyclone via the PC

The new Cyclone Control SDK from PEmicro offers the developer a DLL (Dynamic Link Library), sample applications and supporting documentation so that custom software applications can control the Cyclone directly.

Binary data information, algorithm information, programming processes and other settings are saved together in a SAP image, which is saved directly in the FLASH memory of the Cyclone. Programming processes can be started at the push of a button on the Cyclone. However, the SDK allows a PC to give the Cyclone a command to start the same programming sequence and also to provide other functions, e.g. B. the ability to add dynamics data to each card to be programmed and the ability to recover error information.

The use of a PC to control the cyclone improves the functionality of the independent programming processes and introduces new functions that were not previously available. The following sections explain the functions of the SDK and practical examples for use in your own automated production line.


2. Using the SDK - Simple example




The code example above shows a very basic operation supported by the SDK. Below are the steps we have taken:

Contact the desired cyclone by entering its name ("Fixture1Cyclone1"). The port list ("USB1", "ETHERNET1" or "COM1") or the IP address ("") of the device can also be specified. The handle of the Cyclone is returned and used to identify the Cyclone in all subsequent function calls.
Send a command to the Cyclone to start the programming operations specified in Image 1. These operations were determined during the image creation.
Wait for the Cyclone to finish programming before proceeding.
Check for any errors during programming and return the error code and a message to the user.
End the current session with the Cyclone.


3. Using the SDK - Advanced Features

a.) Program the serial number
The Cyclone already has a programming mechanism for serial numbers integrated in the SAP image. The Cyclone can track and automatically increment the serial number after a card has been successfully programmed. Serial numbers can also be programmed as dynamic data on target cards via the SDK. In this case, the Cyclone's serial number capability is not used. Rather, the calling application provides the dynamic data and programs it after the main image data has already been programmed.




Note: The following placeholder functions serve to simplify the example and are not provided by the automated control package:

The sample code above is based on the previous simple example, which instructs the cyclone to do the self-programming of the image stored on the cyclone. Then we program a dynamic 2-byte serial number in the address 0x1000 of the target processor. The serial number is then incremented and written back to a file for later use.

The SDK offers a lot of flexibility when dealing with serial numbers. This code example can easily be modified to program dynamic data that is not sequential. For example, if we want to program the current date or a lot number. This code example can also be expanded to use multiple cyclones (see Section 5) that share an incremental serial number between all cyclone units. Each of these requirements can be easily met by writing your own custom application using the SDK.

b.) Automatically update the image saved in the Cyclone




This is a very simple example of how you can ensure that the image stored on a Cyclone is always up to date. A comparison is made between the image currently on the Cyclone and an image file in a specific location on the host PC. If there is a mismatch, we update the image. After that, we continue with the normal programming operations, as shown in the previous examples.

c.) Working with properties
Cyclone, Cyclone network, and saved image settings can now be obtained directly from a Cyclone using the property mechanism. With the image properties you can read out information such as the image CRC, the current serial number and the energy settings. With the cyclone properties you can read or set values ​​like the cyclone name, which can then be used to open the cyclone in the future. You can see a list of the categories and properties in the header file of the programming examples included in the SDK.




The getPropertyList routine returns a list of valid categories and their properties. The getPropertyValue routine returns the value of the category and property that you pass as arguments.


4. Use the SDK - gear operation example

In previous examples, we discussed some uses of the SDK with a single cyclone unit. Since the host PC sends minimal control information to control each cyclone, a single PC can actually control multiple Cyclone units at the same time.




Here we start programming 3 separate Cyclone units that are connected to the host PC. This also works if all Cyclones are connected to a mix of different ports. Then we wait for it to finish before we continue. We basically program 3 separate devices in parallel. This can easily be expanded to up to 100 Cyclone units in a network that is controlled in parallel from a single host PC.

More information - Setting up a standalone programming image
The first step is always to create the actual standalone images that will be stored on the Cyclone. These images contain the algorithm required for programming FLASH / EEPROM, the binary data actually to be programmed, the sequence of the programming processes and many user-defined cyclone settings. The PEmicro cyclone image creation utility allows the user to properly configure the standalone image.




Above is a screenshot of the dialog box in the cyclone image creation utility that allows the user to configure the standalone image. The field on the right shows the programming steps and the order in which these steps are carried out.

First, we choose the appropriate algorithm for our processor. In this example we use the NXP Kinetis KL25Z128.
Next, we specify the target object file that represents the binary data to be programmed into the processor's FLASH memory. Here we use a Motorola S record file.
Once the algorithm and the target object file are specified, we can start programming. Typically, the device is erased to ensure that it is empty, programs the target, and verifies that the content was written correctly. When you select the Start Script Wizard option, the utility automatically creates the programming sequence for you.




In addition to the programming sequence, there are also settings for the Cyclone that we can configure. In the screenshot above, we use the Cyclone Universal's power relays to provide the 3.0 volts to turn on our processor. This way we don't need a separate power supply for our target board, which simplifies our production line.




Finally, we provide the image description so that we can easily identify the image later. This is the text that appears on the Cyclone screen. With the option "Save image to hard disk" we can save this image and its configuration as a .SAP file for future use with the SDK.

Display per page
Sort by

PEmicro Cyclone FX Universal - ISP Programmer

Product no.: CYCLONE-FX-UNIV

Production in-system programmer for Cortex Flash and 8/16/32 bit components with 1 GB memory and 75 Mbits / s programming speed.

1,399.00 *
Product data sheet

can be shipped within 1-2 days

PEmicro Cyclone LC Universal - ISP Programmer

Product no.: CYCLONE-LC-UNIV

The Production In System programmer Cyclone LC Universal supports ARM Cortex Flash components and 8/16/32 bit components.

999.00 *
Product data sheet
In Stock, Delivery within 1-2 working days

PEmicro Cyclone LC ARM - ISP Programmer

Product no.: CYCLONE-LC-ARM

The Cyclone LC ARM is a production in-system programmer for ARM Cortex Flash and 16 MB internal memory.

799.00 *
Product data sheet
In Stock, Delivery within 1-2 working days

Plus Vat for enduser and companies located in Germany