Cprogcfz User Guide
Cprogcfz User Guide
05
1 Introduction
CPROGCFZ is a Windows command-line version of the PROGCFZ software which
programs Flash, EEPROM, EPROM, etc. through a PEMicro hardware interface to a
supported NXP ColdFire V2/3/4 processor. The hardware interfaces are available
from PEMicro.
Once your interface hardware, such as a compatible PEMicro Multilink, Cyclone, or
Tracelink, is properly connected between your PC and target device, you may launch
the CPROGCFZ executable from the command line. In addition to the executable,
multiple command-line parameters must also be passed in order to configure which
PEMicro hardware interface CPROGCFZ should attempt to connect to, and to
configure how that hardware interface will connect to the target device. These
parameters include the name of the configuration (.CFG) file, as well as startup
commands such as the name of the hardware interface or the port to which the
interface is connected.
The .CFG file specifies how to program the target as you intend, and it includes
standard programming commands and, optionally, configuration commands. The
following chapters will provide a detailed explanation of these commands and
parameters.
2 Startup
a. Connect the hardware interface between your PC and the target MCU via the
debug ribbon cable.
b. Start the programming software by running it from the Windows Command
prompt or by calling the CPROGCFZ executable with the correct command
line parameters. Allowed command line parameters are:
Examples:
INTERFACE=CYCLONE PORT=MyCyclone99
INTERFACE=CYCLONE "PORT=Joe's Max"
Examples:
INTERFACE=USBMULTILINK PORT=PE5650030
Example: SHOWPORTS=C:\MYPORTS.TXT
This list does not show parallel port or COM port options
which are also available. Below is an example of the output
for various hardware interfaces connected to the PC (Note
INTERFACE=CYCLONE PORT=10.0.9.197
; 10.0.9.197 : Public Cyclone Max[PortNum=61]
INTERFACE=CYCLONE "PORT=Public Cyclone Max"
; 10.0.9.197 : Public Cyclone Max[PortNum=61][DUPLICATE]
INTERFACE=TRACELINK PORT=10.1.5.2
; 10.1.5.2 : MCF52259_TRACE[PortNum=123]
INTERFACE=TRACELINK PORT=MCF52259_TRACE
; 10.1.5.2 : MCF52259_TRACE[PortNum=123][DUPLICATE]
[reset_delay n] Specifies a delay after the programmer resets the target that
[bdm_speed n] This option allows the user to set the BDM shift clock speed
of PEMicro's debug interface. This integer value may be used
to determine the speed of communications according to the
following equations:
[nopst] By default, the PROG software will use the PST[3:0] signals
on the 26-pin background mode connector to determine the
device state during programming. To reduce the physical
footprint, some setups may not connect the PST[3:0] signals
to the 26 pin connector. The ‘nopst’ parameter instructs the
command-line programmer that it must use an alternative
method to determine the device state since the PST[3:0]
signals are absent. The disadvantage of using this alternative
method is that the programming speed is slower.
3 Programming Commands
Programming commands all start with a two character sequence followed by white
space (blanks or tabs). Lines starting with characters which are not commands are
listed as REMarks. The term filename means a full DOS path to a file. Commands use
the same two letter codes as used in the interactive programmers PROGCFZ. The
same .CFP files used by PROGCFZ are used to set up for a particular device to be
programmed. If a user function is specified for a particular device, its two character
command and the meaning or user_par are specified in the .CFP file.
Note: The command parameters starting_addr, ending_addr, base_addr, byte, word, and
user_par use a default hexadecimal format.
:CUSTOMTRIMREF nnnnnnnn.nn
Desired internal reference clock frequency for the “PT; Program Trim” command. This
:DEVICEPOWER n
For Cyclone (excludes Cyclone MAX). This setting defines the target voltage that will
be provided to the target if the source of the voltage is derived from the Cyclone's
internal power. Valid values of n are:
0 : 5 Volts, Generated/Switched by Cyclone
2 : 3 Volts, Generated/Switched by Cyclone
4 : 2 Volts, Generated/Switched by Cyclone
:PROVIDEPOWER n
Determines whether interface should provide power to the target. NOTE: Not all
hardware interfaces support this command. Valid values of n are:
0 : Interface does not provide power to target. (default)
1 : Enable Interface provides power to target.
(NOTE: Is the same as legacy option :USEPRORELAYS n)
:POWERDOWNDELAY n
Amount of time to delay when the power to the target is turned off for the targets
power supply to drop to below 0.1v. n is the time in milliseconds.
:POWERUPDELAY n
Amount of time to delay when the power to the target is turned on OR the target is
reset, and before the software attempts to talk to the target. This time can be a
combination of power on time and reset time (especially if a reset driver is used). n
is the time in milliseconds.
:POWEROFFONEXIT n
Determines whether power provided to the target should be turned off when the
5 Verification Overview
There are several commands available that can be used to verify the contents of the
flash on the device after programming it. The most widely used command is “VC
;Verify CRC of Object File to Module”. The “VC” command will instruct CPROGCFZ to
first calculate a 16-bit CRC value from the chosen object file. CPROGCFZ will then
load code into the RAM of the device and instruct the device to calculate a 16 bit CRC
value from the contents in FLASH of the device. Only valid address ranges in the
object file are calculated on the device. Once the 16-bit CRC value from the object file
and the device are available, CPROGCFZ compares them. An error is thrown if the
two values do not match.
Alternatively, the “VM ;Verify Module” command can be used to perform a byte by
byte verification between the chosen object file and the device. Typically, the VM
command will take longer to perform than VC command since CPROGCFZ has to
read the contents of FLASH of the device byte by byte. There are also two other
commands that can be used for verification. The “SC ;Show Module CRC” instructs
CPROGCFZ to load code into the RAM of the device and instruct the device to
calculate a 16-bit CRC value from the contents of the entire FLASH of the device,
which includes blank regions. Once the 16-bit CRC value has been calculated,
CPROGCFZ will display the value in the status window. The “VV ;Verify Module CRC
to Value” command is similar to the “SC” command. The difference is that instead of
displaying the calculated 16-bit CRC value, CPROGCFZ will compare the calculated
value against a 16-bit CRC value given by the user.
Note: The path names of files that are relative to the CPROG executable can also be
used.
As an example, the following generic script could be used for programming with
exactly the same functionality of the example script in Section 7 - Example
Programming Script File:
“/PARAM1=C:\PEMICRO\Freescale_52211_1x32x32k.CFP 4000"
/PARAM2=C:\PEMICRO\TEST.S19
/PARAM3=VM
NOTE: Since the /PARAM1 parameter has a space in its value, the entire parameter
needs to be enclosed in double quotations. This indicates to Windows that it is a
single parameter. In this instance, a base address of 0x4000 is included on the
Choose Module line in the script, therefore /PARAM1 must be specified on the
command line like this:
“/PARAM1=C:\PEMICRO\Freescale_52211_1x32x32k.CFP 4000"
So the complete example command line would be (note that this is continuous; no line
breaks):
Windows NT/2000/Vista/7/8:
Windows 95/98/ME/XP:
Note: The path names of files that are relative to the CPROG executable can also be
used.
10 Information
For more information on CPROGCFZ and PROGCFZ and how to construct .CFP files
for your own devices, please contact:
To view our entire library of.CFP modules, go to the Support page of PEMicro's
website at www.pemicro.com/support.