A volume production solution often relies on simultaneous gang programming of different target boards to meet speed and throughput requirements. This programming scenario may integrate Cyclone programmers into a fixture which interfaces to a panel of boards to be programmed. Programming is commonly controlled and monitored from a local computer, especially when customized dynamic data is being added to the main binary image that is being programmed into each target. PEmicro’s gang programming solution is to control many Cyclone programmers simultaneously via the Cyclone Control Suite. A mix of programming images, targets, and data can be simultaneously programmed into many devices while maintaining a high level of performance because each Cyclone is itself an independently operating programmer. The Cyclone Control Suite offers multiple means of controlling gang programming operations. The Cyclone Control Console is a scriptable command-line utility which makes gang programming extremely easy to set up and run. The Cyclone Control SDK is based around a dynamically linked library (DLL or SO) and allows detailed gang programming control from many tools, languages, and environments on the host PC. Cyclones can be connected to the host computer directly using USB or remotely via Ethernet. 1. Gang Programming using the Cyclone Control Console The quickest way to accomplish gang programming is by using the Cyclone Control Console. The Cyclone Control Console is a powerful command-line application that allows simultaneous control of one or more Cyclones. Programming images can be added/removed, settings read/set, programming operations launched, and dynamic data programmed. The command-line application displays comprehensive status messages and also returns a result code indicating success or failure. The application can be launched from a script, a console, or another application Opening multiple Cyclones with the Console is simple. Either pass a comma-delimited list of Cyclone names to the -cyclone= parameter (such as -cyclone=agnes,colossus,hal9000) or use multiple -cyclone parameters (such as -cyclone=agnes -cyclone=colossus -cyclone=hal9000). The other operations on the command-line will be executed on all open Cyclones, including programming launch, with the exception of dynamic data programming (where the Cyclone to which to apply the dynamic data is specified as part of the parameter). Here is an example of listing images on two Cyclones: The same image can be launched on multiple Cyclones simultaneously simply by specifying multiple Cyclones on the command-line. If different image sets exist on each Cyclone, using condensed image descriptions is a good way to guarantee the appropriate programming image is launched. If the image set on each Cyclone is the same, the image number will match, and as such the image number is another way to launch the same image on multiple Cyclones. The following example launches the "Green Image v1.0" programming image on three different Cyclones simultaneously. The Cyclones are referenced by name (Agnes, Colossus, HAL9000) and the image is referenced by the condensed image description "GreenImagev1.0"). In addition to programming the data that's included as part of a programming image, additional unique data can also be programmed on target by target basis. This "dynamic" data can be specified each time a programming image is launched. Then the Cyclone combines the dynamic data with your static data image before programming all the data to your target. Dynamic data has many use cases: customer driven serialization, configuration, tracking, date coding, etc. Multiple sets of dynamic data can be specified on the command-line. As part of the specify overlay data parameter, the Cyclone handle number must be specified, the address where the data is programmed, and the data as an array of bytes. The syntax for specifying overlay data is: -specifyOverlayData=1, 1080, 1,2,3,4,5,6 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: In addition to displaying success and error information as strings written to the Console, the Cyclone Control Console also returns an appropriate error code to the operating system on the PC. An application or various scripting languages can be used to test for this error code. A zero error code indicates successful operation, and a non-zero error code indicates a failure. Here is an example of a python script which can successfully recover success/error information from the Cyclone Control Console: Here is an example of a Windows Batch file which can successfully recover success/error information from the Cyclone Control Console: Here is an example of a bash shell script which can successfully recover success/error information from the Cyclone Control Console: PEmicro’s Cyclone Control SDK provides the developer with a dynamically loadable shared library (DLL or SO), example application code, and supporting documentation to allow custom software applications to directly control the Cyclone. Languages and environments such as C,C++, Delphi, C#, Java, Python, and Labview are supported. Binary data information, algorithm information, programming operations, and other settings are stored together in a SAP image which is saved directly into the FLASH memory of the Cyclone. Programming operations can be initiated by the push of a button on the Cyclone, however, the SDK enables a PC to issue a command to the Cyclone to start the same programming sequence, and also to provide other capabilities, such as the ability to add dynamic data to each board being programmed, and the ability to recover error information. Connecting to multiple Cyclones using the SDK is very simple. Below is an example of what the code would look like in C: Here, the programming operations are started on 3 separate Cyclone units that are connected to the host PC. This will work even if all the Cyclones are connected on a mix of different ports or remotely away from the PC. The program then waits for their completion before proceeding. In essence, 3 separate devices are programmed in parallel. Many Cyclone units can be controlled in parallel from a single host PC as the programming work is done on the Cyclones themselves. In the example below a serial number is programmed into each of the targets connected to the three Cyclones. To do this, the code calls the “startDynamicDataProgram” routine. The arguments are the Cyclone handle returned from “connectToCyclone,” the address to be programmed (which is address 0 in this case), the length of the data to be programmed, and a char buffer. The Cyclone Control SDK gives the user the option to check for errors after the execution of a programming command has finished (indicated when checkCycloneExecutionStatus returns 0). To check for errors, call the “getNumberOfErrors” routine with the Cyclone handle as the lone argument. The return value of this routine is the number of errors in the specified Cyclone. If this value is 0, there were no errors. By using the “getErrorCode” function with the Cyclone handle and the error number (1..the number of errors), the user can get the error code number of the error which occured. For more information, the error code and be passed to the “getDescriptionOfErrorCode” routine in the Cyclone Control SDK which returns a detailed text description of the error. It is very easy to create a gang programming setup using PEmicro's Cyclone Control Suite in combination with multiple Cyclones. Since each Cyclone is itself an independently operating programmer, a mix of programming images, targets, and data can be simultaneously programmed into many devices while maintaining a high level of performance. The Cyclone Control Console makes gang programming extremely easy to set up, while the Cyclone Control SDK allows detailed customization of gang programming control from many tools, languages, and environments. Connecting to multiple Cyclones
Launching main image programming on multiple cyclones
Providing additional dynamic data for each individual target being programmed
Recovering success/error result from python/bash/batch/etc.
import subprocess
import sys
P = subprocess.run("cyclonecontrolconsole -cyclone=Agnes -launchimage=green_serial", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print("Printing STDOUT:")
print(P.stdout.decode())
if P.returncode == 0:
print("Successfully programmed!")
else:
print("Programming FAILED!!! with error code " + str(P.returncode))
sys.exit(1)
cyclonecontrolconsole -cyclone=Agnes -launchimage=green_serial
if ERRORLEVEL 1 goto errorOccurred
echo Successfully programmed!
goto done
:errorOccurred
echo Programming FAILED!!!!!
:done
#!/bin/bash
cyclonecontrolconsole -cyclone=Agnes -launchimage=green_serial
errorReturn=$?
if [ $errorReturn == 0 ]; then
echo 'Successfully programmed!'
else
echo 'Programming FAILED!!!!! with error code '$errorReturn
exit 1
fi
2. Gang Programming using the Cyclone Control SDK
Connecting to Multiple Cyclones and Launching a Programming Image
Providing additional dynamic data for each individual target being programmed
Checking for Errors
Conclusion
Tags related to this Blog Post
Cyclone
Cyclone FX
Interface Library Routines
ARM
STMicroelectronics
Production Programming
Automated Control