Visible to Intel only — GUID: sam1408419666328
Ixiasoft
Visible to Intel only — GUID: sam1408419666328
Ixiasoft
1.8. Updating Devices Using Jam
JBI_RETURN_TYPE jbi_execute ( PROGRAM_PTR program long program_size, char *workspace, long workspace_size, char *action, char **init_list, int reset_jtag long *error_address, int *exit_code, int *format_version )
The code within main() in jbistub.c determines the variables that are passed to jbi_execute(). In most cases, this code is not applicable to an embedded environment. Therefore, you can remove this code and set up the jbi_execute() routine for the embedded environment.
Before calling the jbi_execute function, construct init_list with the correct arguments that correspond to the valid actions in .jbc, as specified in the JEDEC standard JESD71 specification. The init_list is a null-terminated array of pointers to strings.
An initialization list tells the Jam™ STAPL Byte-Code Player the types of functions to perform—for example, program and verify—and this list is passed to jbi_execute(). The initialization list must be passed in the correct manner. If an initialization list is not passed or the initialization list is invalid, the Jam™ STAPL Byte-Code Player simply checks the syntax of the .jbc and if there is no error, returns a successful exit code without performing the program function.
Code to Set Up init_list for Performing Program and Verify Operation
char CONSTANT_AREA init_list[][] = "DO_PROGRAM=1", "DO_VERIFY=1";
The default code in the Jam™ STAPL Byte-Code Player sets init_list differently and is used to give instructions to the Jam™ STAPL Byte-Code Player from the command prompt.
The code in this example declares the init_list variable while setting it equal to the appropriate parameters. The CONSTANT_AREA identifier instructs the compiler to store the init_list array in the program memory.
After the Jam™ STAPL Byte-Code Player completes a task, the player returns a status code of type JBI_RETURN_TYPE or integer. A return value of "0" indicates a successful action. The jbi_execute() routine can return any of the exit codes as defined in the Jam™ STAPL Specification.