Chapter 14: Using Jam STAPL for ISP via an Embedded Processor
14–17
Updating Devices Using Jam
Table 14–8. Exit Codes
Exit Code
Description
0
1
Success
Checking chain failure
Reading IDCODEfailure
Reading USERCODEfailure
Reading UESCODEfailure
Entering ISP failure
2
3
4
5
6
Unrecognized device ID
Device version is not supported
Erase failure
7
8
9
Blank check failure
10
11
12
13
14
15
16
17
Programming failure
Verify failure
Read failure
Calculating checksum failure
Setting security bit failure
Querying security bit failure
Exiting ISP failure
Performing system test failure
Running the Jam STAPL Byte-Code Player
Calling the Jam STAPL Byte-Code Player is like calling any other sub-routine. In this
case, the sub-routine is given actions and a file name, and then it performs its
function.
In some cases, in-field upgrades can be performed depending on whether the current
device design is up-to-date. The JTAG USERCODE is often used as an electronic
“stamp” that indicates the PLD design revision. If the USERCODE is set to an older
value, the embedded firmware updates the device. The following pseudocode
illustrates how the Jam Byte-Code Player could be called multiple times to update the
target PLD:
result = jbi_execute(jbc_file_pointer, jbc_file_size, 0, 0,
“READ_USERCODE”, 0, error_line, exit_code);
The Jam STAPL Byte-Code Player will now read the JTAG USERCODE and export it
using the jbi_export()routine. The code can then branch based upon the result.
© October 2008 Altera Corporation
MAX II Device Handbook