* TFTP:: TFTP
* GDB and OpenOCD:: Using GDB and OpenOCD
* Tcl Scripting API:: Tcl Scripting API
-* Upgrading:: Deprecated/Removed Commands
* FAQ:: Frequently Asked Questions
* Tcl Crash Course:: Tcl Crash Course
* License:: GNU Free Documentation License
is jim, not real tcl).
@end quotation
-@node Upgrading
-@chapter Deprecated/Removed Commands
-@cindex Deprecated/Removed Commands
-Certain OpenOCD commands have been deprecated or
-removed during the various revisions.
-
-Upgrade your scripts as soon as possible.
-These descriptions for old commands may be removed
-a year after the command itself was removed.
-This means that in January 2010 this chapter may
-become much shorter.
-
-@itemize @bullet
-@item @b{arm7_9 fast_writes}
-@cindex arm7_9 fast_writes
-@*Use @command{arm7_9 fast_memory_access} instead.
-@xref{arm7_9 fast_memory_access}.
-@item @b{endstate}
-@cindex endstate
-@*An buggy old command that would not really work since background polling would wipe out the global endstate
-@item @b{arm7_9 force_hw_bkpts}
-@*Use @command{gdb_breakpoint_override} instead. Note that GDB will use hardware breakpoints
-for flash if the GDB memory map has been set up(default when flash is declared in
-target configuration). @xref{gdb_breakpoint_override}.
-@item @b{arm7_9 sw_bkpts}
-@*On by default. @xref{gdb_breakpoint_override}.
-@item @b{daemon_startup}
-@*this config option has been removed, simply adding @option{init} and @option{reset halt} to
-the end of your config script will give the same behaviour as using @option{daemon_startup reset}
-and @option{target cortex_m3 little reset_halt 0}.
-@item @b{dump_binary}
-@*use @option{dump_image} command with same args. @xref{dump_image}.
-@item @b{flash erase}
-@*use @option{flash erase_sector} command with same args. @xref{flash erase_sector}.
-@item @b{flash write}
-@*use @option{flash write_bank} command with same args. @xref{flash write_bank}.
-@item @b{flash write_binary}
-@*use @option{flash write_bank} command with same args. @xref{flash write_bank}.
-@item @b{flash auto_erase}
-@*use @option{flash write_image} command passing @option{erase} as the first parameter. @xref{flash write_image}.
-
-@item @b{jtag_device}
-@*use the @command{jtag newtap} command, converting from positional syntax
-to named prefixes, and naming the TAP.
-@xref{jtag newtap}.
-Note that if you try to use the old command, a message will tell you the
-right new command to use; and that the fourth parameter in the old syntax
-was never actually used.
-@example
-OLD: jtag_device 8 0x01 0xe3 0xfe
-NEW: jtag newtap CHIPNAME TAPNAME \
- -irlen 8 -ircapture 0x01 -irmask 0xe3
-@end example
-
-@item @b{jtag_speed} value
-@*@xref{JTAG Speed}.
-Usually, a value of zero means maximum
-speed. The actual effect of this option depends on the JTAG interface used.
-@itemize @minus
-@item wiggler: maximum speed / @var{number}
-@item ft2232: 6MHz / (@var{number}+1)
-@item amt jtagaccel: 8 / 2**@var{number}
-@item jlink: maximum speed in kHz (0-12000), 0 will use RTCK
-@item rlink: 24MHz / @var{number}, but only for certain values of @var{number}
-@comment end speed list.
-@end itemize
-
-@item @b{load_binary}
-@*use @option{load_image} command with same args. @xref{load_image}.
-@item @b{run_and_halt_time}
-@*This command has been removed for simpler reset behaviour, it can be simulated with the
-following commands:
-@smallexample
-reset run
-sleep 100
-halt
-@end smallexample
-@item @b{target} <@var{type}> <@var{endian}> <@var{jtag-position}>
-@*use the create subcommand of @option{target}.
-@item @b{target_script} <@var{target#}> <@var{eventname}> <@var{scriptname}>
-@*use <@var{target_name}> configure -event <@var{eventname}> "script <@var{scriptname}>"
-@item @b{working_area}
-@*use the @option{configure} subcommand of @option{target} to set the work-area-virt, work-area-phy, work-area-size, and work-area-backup properties of the target.
-@end itemize
-
@node FAQ
@chapter FAQ
@cindex faq
static int handle_interface_list_command(struct command_context_s *cmd_ctx,
char *cmd, char **args, int argc);
static int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int handle_jtag_speed_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
static int handle_jtag_khz_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
static int handle_jtag_rclk_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int handle_jtag_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
static int handle_reset_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
static int handle_jtag_nsrst_delay_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
static int handle_jtag_ntrst_delay_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
register_command(cmd_ctx, NULL,
"interface_list", &handle_interface_list_command,
COMMAND_ANY, "list all built-in interfaces");
- register_command(cmd_ctx, NULL, "jtag_speed", handle_jtag_speed_command,
- COMMAND_ANY, "(DEPRECATED) set jtag speed (if supported)");
register_command(cmd_ctx, NULL, "jtag_khz", handle_jtag_khz_command,
COMMAND_ANY, "set maximum jtag speed (if supported); "
"parameter is maximum khz, or 0 for adaptive clocking (RTCK).");
register_command(cmd_ctx, NULL, "jtag_rclk", handle_jtag_rclk_command,
COMMAND_ANY, "fallback_speed_khz - set JTAG speed to RCLK or use fallback speed");
- register_command(cmd_ctx, NULL, "jtag_device", handle_jtag_device_command,
- COMMAND_CONFIG, "(DEPRECATED) jtag_device <ir_length> <ir_expected> <ir_mask>");
register_command(cmd_ctx, NULL, "reset_config", handle_reset_config_command,
COMMAND_ANY,
"reset_config "
return ERROR_OK;
}
-static int handle_jtag_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
-{
- int e;
- char buf[1024];
- Jim_Obj *newargs[ 10 ];
- /*
- * CONVERT SYNTAX
- * argv[-1] = command
- * argv[ 0] = ir length
- * argv[ 1] = ir capture
- * argv[ 2] = ir mask
- * argv[ 3] = not actually used by anything but in the docs
- */
-
- if (argc < 4) {
- command_print(cmd_ctx, "OLD DEPRECATED SYNTAX: Please use the NEW syntax");
- return ERROR_OK;
- }
- command_print(cmd_ctx, "OLD SYNTAX: DEPRECATED - translating to new syntax");
- command_print(cmd_ctx, "jtag newtap CHIP TAP -irlen %s -ircapture %s -irvalue %s",
- args[0],
- args[1],
- args[2]);
- command_print(cmd_ctx, "Example: STM32 has 2 taps, the cortexM3(len4) + boundaryscan(len5)");
- command_print(cmd_ctx, "jtag newtap stm32 cortexm3 ....., thus creating the tap: \"stm32.cortexm3\"");
- command_print(cmd_ctx, "jtag newtap stm32 boundary ....., and the tap: \"stm32.boundary\"");
- command_print(cmd_ctx, "And then refer to the taps by the dotted name.");
-
- newargs[0] = Jim_NewStringObj(interp, "jtag", -1);
- newargs[1] = Jim_NewStringObj(interp, "newtap", -1);
- sprintf(buf, "chip%d", jtag_tap_count());
- newargs[2] = Jim_NewStringObj(interp, buf, -1);
- sprintf(buf, "tap%d", jtag_tap_count());
- newargs[3] = Jim_NewStringObj(interp, buf, -1);
- newargs[4] = Jim_NewStringObj(interp, "-irlen", -1);
- newargs[5] = Jim_NewStringObj(interp, args[0], -1);
- newargs[6] = Jim_NewStringObj(interp, "-ircapture", -1);
- newargs[7] = Jim_NewStringObj(interp, args[1], -1);
- newargs[8] = Jim_NewStringObj(interp, "-irmask", -1);
- newargs[9] = Jim_NewStringObj(interp, args[2], -1);
-
- command_print(cmd_ctx, "NEW COMMAND:");
- sprintf(buf, "%s %s %s %s %s %s %s %s %s %s",
- Jim_GetString(newargs[0], NULL),
- Jim_GetString(newargs[1], NULL),
- Jim_GetString(newargs[2], NULL),
- Jim_GetString(newargs[3], NULL),
- Jim_GetString(newargs[4], NULL),
- Jim_GetString(newargs[5], NULL),
- Jim_GetString(newargs[6], NULL),
- Jim_GetString(newargs[7], NULL),
- Jim_GetString(newargs[8], NULL),
- Jim_GetString(newargs[9], NULL));
-
- e = jim_jtag_command(interp, 10, newargs);
- if (e != JIM_OK) {
- command_print(cmd_ctx, "%s", Jim_GetString(Jim_GetResult(interp), NULL));
- }
- return e;
-}
-
static int handle_scan_chain_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
jtag_tap_t *tap;
return ERROR_OK;
}
-static int handle_jtag_speed_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
-{
- int retval = ERROR_OK;
-
- command_print(cmd_ctx, "OLD SYNTAX: DEPRECATED - "
- "use jtag_khz, not jtag_speed");
-
- if (argc > 1)
- return ERROR_COMMAND_SYNTAX_ERROR;
- if (argc == 1)
- {
- LOG_DEBUG("handle jtag speed");
-
- unsigned cur_speed = 0;
- COMMAND_PARSE_NUMBER(uint, args[0], cur_speed);
-
- retval = jtag_config_speed(cur_speed);
- }
- command_print(cmd_ctx, "jtag_speed: %d", jtag_get_speed());
-
- return retval;
-}
-
static int handle_jtag_khz_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
if (argc > 1)