|
|
| |
 |
JTAG FLASH Device Programming and CPLD, FPGA JTAG Device Programming
|
JTAG FLASH, CPLD and FPGA Programming
The XJTAG JTAG Flash and Device Programmer included in XJEASE, lets you quickly and easily perform JTAG FLASH Programming operations on your hardware, allowing you to configure your in-circuit JTAG Test unit to program erase and
verify Flash devices.
The Flash commands
and scripts let you create a user defined list of Flash and target operations that
you can execute on demand. For additional flexibility, you can call your scripts from the provided XJRUNNER application or from a user created GUI interface. The COM Interface available for XJEase lets you call your tests from test executives such as LabVIEW, Visual Basic, and other Windows-based custom applications.
The XJTAG website has a range of Flash device files for you to download, which include functions to program the Flash with any image. These files simply use the programming algorithms from the device datasheets, as for any other non-JTAG device test in XJEase. There’s no need to list the connections between the Flash and your JTAG devices — XJEase uses your netlist to automatically work this out. The underlying XJEase system then generates the required vectors to program your Flash.
JTAG Device Programming
Many JTAG devices, such as CPLDs and FPGAs, can be programmed directly using STAPL / JAM or SVF files. These files can be generated by the manufacturer’s toolkit used to create the programs for the devices. STAPL /JAM and SVF files can be used to program devices as a standalone process. Alternatively, this can easily be integrated into the rest of the test system using a single line of code in XJEase.
Flash operations are controlled
by two files:
Flash Configuration
File - defines; erase, program, verify and target
operations to be performed along with a description of he flash
devices(address, size, type).
Configuration
(.def) File - sets up your target environment(like chip
selects and memory access size ) to allow access to your
flash devices.
Before performing
flash operations, modify your initialization to
allow access to your target’s flash devices and to configure
a target workspace (RAM) for Flash operations. For information on
setting up your configuration, please refer to your
manual.
Multiple Operations and Devices
Within the defined
workspace, supports multiple user-defined
Sections. A Section is a description of the
Flash operation which includes the following:
Section Parameter |
Description |
Device |
Device to be
programmed |
Algorithm |
Programming method |
Size |
Storage capacity (in
bytes) of one device |
Bit-width |
Target memory bus
width |
Address |
Physical address of
selected device or sector |
Image file |
File containing
memory image |
Load address/offset |
Address at which
memory image is programmed |
File format |
Format of Image file |
Erase Mode |
Specifies which part
of device is affected by selected operation |
Unlock/Erase Sector
Size |
Size of device
sectors |
Unlock/Erase Sector
Count |
Number of sectors |
Optional Commands
and Macros |
Optional macros and
commands, emulator commands, GDB commands |
Once the Sections are
defined, you can use flash operations to specify the
type and sequence of operations.
Flash Configuration
Window
To display the
Flash Configuration window, select Display Flash configuration from
the Flash menu. displays the following window.
As indicated above, the
Flash Configuration window enables you to:
- Load and save
Flash configurations
- Create and delete sections
- Erase, program and verify
flash devices
When you initially bring up
the Flash Configuration window, it displays the Workspace
address and whether the workspace is enabled. This
information comes from the emulator configuration file’s
Flash section. The Workspace address is the base
address of a section RAM that you dedicate for Flash
operations. Workspace Enable indicates whether that space is
enabled for these operations. If the address is 0xFFFFFFFF
and the Workspace Enable value is False, no target RAM is used for
Flash operations. Using RAM for Flash operations generally
speeds the process of these operations. If valid RAM is not
available at the address defined in your configuration file, all
operations will fail.
Additionally,
displays the timeout setting from the emulator
configuration file. This setting defines the amount of time
the emulator waits before returning from a failed operation with an
error. This setting may be modified in the
Flash Configuration window by double-clicking the current
entry and typing the new value in the dialog box that appears.
Creating Sections
To illustrate how to create
and use sections, let us assume that we want to use two methods to
erase our Flash device. First, we need an operation
that erases the entire device and second, we need an operation that
erases the first sector of the device. To accomplish this we
define two Sections:
- A Section named "Erase
All" that is responsible for erasing the entire Flash device
starting at address 0xFFC00000.
- A Section named "Erase
First Sector" that erases the first sector of the device starting at
address 0xFFC00000.
To create the Sections:
- Click the Add new section
button in the Flash Configuration window.
- Type Section name in the
Create New Flash Section dialog and click OK.
- Note the display of the
framework for Section settings in the Flash Configuration
window.
- Point to Device, click
the RMB and select the geometry of the target’s
Flash device. A list of supported devices
appears. Find the device and double-click. For our
example, let us select the 16-bit device, AM29DL162CB.
- Note that the Device and
other settings are changed. The Algorithm, Size and Bit-width
setting now reflect the default settings for the device
selected. Typically, there is no need to change these
settings. To do so, point to the setting, click the RMB and
select the menu item that provides the desired setting. If
you know the algorithm for your device, you can skip the Device setting
and select the proper algorithm from the Algorithm RMB menu.
If the device algorithm is selected in this way, the device size
setting must be set. To set the Size setting, point to the
setting, click the RMB and select the proper size from the menu.
- Double-click the
Flash Address setting and enter the physical base
address of the selected device in the Flash Address dialog and
click OK. For the example, we enter 0xFFC00000.
- Point to the Erase Mode
setting and click the RMB. Select the desired erase mode and
click. For our example, let us select Erase chip mode.
- For sector-based
Flash device, you can define the sector size that you want to
unlock for erase operations. To select a sector size point to Unlock/Erase
Sector Size: in the Flash configuration window
and click the RMB. From the RMB menu that appears, select the
desired sector size. The picture below illustrates selection
of a 64KB sector size.
- For sector-based
Flash devices, you may select the number of sectors for an
erase operation. To edit the sector count, point to Unlock/Erase Sector Count:
and click the RMB. Type the desired number of sectors in the
dialog that appears and click OK.
- Image File, Load
Address/Offset and File Format settings apply to Program and Verify
operations. Since this section is concerned with the Erase
operation, we can ignore them for now. A section can be
defined and used for any combination of Flash operations.
- The optional Commands and
Macros fields specify , GDB or emulator
commands and macros that you want to run before or after a
Flash operation. Commands and macros are useful to initialize
your system for proper programming and erase operations. They
can also be used after flash operations to lock Flash, reset the target
system or other application specific tasks.
- To create the second
example, we repeat the above steps with the following changes:
- Name the Section
“Erase First Sector”
- Select Erase Mode
The
Erase sections are now ready for use. If we want to erase a
Flash device, click on the Erase flash button in the Flash
Configuration window. The following dialog appears:
The Select
Flash Dialog lists the available sections in the current Flash
Configuration. To select an operation, click the Add
button. Click OK to dismiss dialog and begin
operation. A progress dialog is displayed while the Flash
operation – in this case an erase – proceeds.
Program and Verify
operations
To create a section that
supports Flash program and/or verify operation the process
described above would be repeated. However, to support these
operations, the Image File, Load Address/Offset and File Format
settings require entries. For example, to modify the Section
Erase All to support program and verify operations:
- Double-click the Image
File setting and browse your host or network file system to locate and
select the image you want program or verify.
- Double-click the
Address/Offset setting and enter the address (in hex) in the selected
Flash memory device where the image will be written.
NOTE: For binary download format, this number is an
absolute address. For all other formats, the number
represents an offset from the physical device address.
- Point to the File Format
setting and click the RMB. Select from the menu the format of
the selected image file.
For our example, let us add
the file test.elf to the Section Erase All. The Section
definition now looks like this:
The Section Erase All is now
configured to support all Flash operations. The
process of defining a Flash Configuration section essentially describes
the action that takes place when program, erase and verify operations
are initiated from the Flash Configuration window buttons or Flash menu. The following table summarizes the flash operations.
Creating a Flash Configuration
File
Once all necessary sections
have been defined, the complete configuration can be saved in a
file. Simply click the file save button in the
Flash Configuration window. Once saved, the
configuration can be restored using the Flash Configuration
window’s file open button The combination
of multiple sections per configuration file and the ability to create
and save multiple files, provides tremendous flexibility in controlling
your Flash devices.
|