"reset" without arguments now execute a "reset run".

the reset mode argument to the target command is deprecated(ignored w/error message).

git-svn-id: svn://svn.berlios.de/openocd/trunk@832 b42882b7-edfa-0310-969c-e2dbd0fdcd60
__archive__
oharboe 2008-07-18 14:43:29 +00:00
parent 2c3f0ebae9
commit 35e84a2a25
2 changed files with 27 additions and 38 deletions

View File

@ -516,7 +516,7 @@ Currently, there are no options available for the ep93xx interface.
@section Target configuration @section Target configuration
@itemize @bullet @itemize @bullet
@item @b{target} <@var{type}> <@var{endianess}> <@var{reset_mode}> <@var{JTAG pos}> @item @b{target} <@var{type}> <@var{endianess}> <@var{JTAG pos}>
<@var{variant}> <@var{variant}>
@cindex target @cindex target
Defines a target that should be debugged. Currently supported types are: Defines a target that should be debugged. Currently supported types are:
@ -538,29 +538,6 @@ target board
Endianess may be @option{little} or @option{big}. Endianess may be @option{little} or @option{big}.
The reset_mode specifies what should happen to the target when a reset occurs:
@itemize @minus
@item @b{reset_halt}
@cindex reset_halt
Immediately request a target halt after reset. This allows targets to be debugged
from the very first instruction. This is only possible with targets and JTAG
interfaces that correctly implement the reset signals.
@item @b{reset_init}
@cindex reset_init
Similar to @option{reset_halt}, but executes the script file defined to handle the
'reset' event for the target. Like @option{reset_halt} this only works with
correct reset implementations.
@item @b{reset_run}
@cindex reset_run
Simply let the target run after a reset.
@item @b{run_and_halt}
@cindex run_and_halt
Let the target run for some time (default: 1s), and then request halt.
@item @b{run_and_init}
@cindex run_and_init
A combination of @option{reset_init} and @option{run_and_halt}. The target is allowed
to run for some time, then halted, and the @option{reset} event script is executed.
@end itemize
On JTAG interfaces / targets where system reset and test-logic reset can't be driven On JTAG interfaces / targets where system reset and test-logic reset can't be driven
completely independent (like the LPC2000 series), or where the JTAG interface is completely independent (like the LPC2000 series), or where the JTAG interface is
@ -591,7 +568,7 @@ a working_area that doesn't need to be backed up, as performing a backup slows d
@subsection arm7tdmi options @subsection arm7tdmi options
@cindex arm7tdmi options @cindex arm7tdmi options
target arm7tdmi <@var{endianess}> <@var{reset_mode}> <@var{jtag#}> target arm7tdmi <@var{endianess}> <@var{jtag#}>
The arm7tdmi target definition requires at least one additional argument, specifying The arm7tdmi target definition requires at least one additional argument, specifying
the position of the target in the JTAG daisy-chain. The first JTAG device is number 0. the position of the target in the JTAG daisy-chain. The first JTAG device is number 0.
The optional [@var{variant}] parameter has been removed in recent versions. The optional [@var{variant}] parameter has been removed in recent versions.
@ -829,12 +806,15 @@ OpenOCD will wait 5 seconds for the target to resume.
@cindex step @cindex step
Single-step the target at its current code position, or at an optional address. Single-step the target at its current code position, or at an optional address.
@item @b{reset} [@option{run}|@option{halt}|@option{init}|@option{run_and_halt} @item @b{reset} [@option{run}|@option{halt}|@option{init}|@option{run_and_halt}
|@option{run_and_init}] |@option{run_and_init}]
@cindex reset @cindex reset
Perform a hard-reset. The optional parameter specifies what should happen after the reset. Perform a hard-reset. The optional parameter specifies what should happen after the reset.
This optional parameter overrides the setting specified in the configuration file, This optional parameter overrides the setting specified in the configuration file,
making the new behaviour the default for the @option{reset} command. making the new behaviour the default for the @option{reset} command.
With no arguments a "reset run" is executed
@itemize @minus @itemize @minus
@item @b{run} @item @b{run}
@cindex reset run @cindex reset run

View File

@ -302,6 +302,8 @@ int target_process_reset(struct command_context_s *cmd_ctx)
if ((retval = jtag_init_reset(cmd_ctx)) != ERROR_OK) if ((retval = jtag_init_reset(cmd_ctx)) != ERROR_OK)
return retval; return retval;
keep_alive(); /* we might be running on a very slow JTAG clk */
/* First time this is executed after launching OpenOCD, it will read out /* First time this is executed after launching OpenOCD, it will read out
* the type of CPU, etc. and init Embedded ICE registers in host * the type of CPU, etc. and init Embedded ICE registers in host
* memory. * memory.
@ -315,6 +317,8 @@ int target_process_reset(struct command_context_s *cmd_ctx)
if ((retval = target_examine(cmd_ctx)) != ERROR_OK) if ((retval = target_examine(cmd_ctx)) != ERROR_OK)
return retval; return retval;
keep_alive(); /* we might be running on a very slow JTAG clk */
/* prepare reset_halt where necessary */ /* prepare reset_halt where necessary */
target = targets; target = targets;
while (target) while (target)
@ -949,6 +953,7 @@ int target_register_commands(struct command_context_s *cmd_ctx)
register_command(cmd_ctx, NULL, "virt2phys", handle_virt2phys_command, COMMAND_ANY, "virt2phys <virtual address>"); register_command(cmd_ctx, NULL, "virt2phys", handle_virt2phys_command, COMMAND_ANY, "virt2phys <virtual address>");
register_command(cmd_ctx, NULL, "profile", handle_profile_command, COMMAND_EXEC, "PRELIMINARY! - profile <seconds> <gmon.out>"); register_command(cmd_ctx, NULL, "profile", handle_profile_command, COMMAND_EXEC, "PRELIMINARY! - profile <seconds> <gmon.out>");
/* script procedures */ /* script procedures */
register_jim(cmd_ctx, "openocd_mem2array", jim_mem2array, "read memory and return as a TCL array for script processing"); register_jim(cmd_ctx, "openocd_mem2array", jim_mem2array, "read memory and return as a TCL array for script processing");
register_jim(cmd_ctx, "openocd_array2mem", jim_array2mem, "convert a TCL array to memory locations and write the values"); register_jim(cmd_ctx, "openocd_array2mem", jim_array2mem, "convert a TCL array to memory locations and write the values");
@ -1413,18 +1418,26 @@ int handle_target_command(struct command_context_s *cmd_ctx, char *cmd, char **a
return ERROR_COMMAND_SYNTAX_ERROR; return ERROR_COMMAND_SYNTAX_ERROR;
} }
/* what to do on a target reset */
(*last_target_p)->reset_mode = RESET_INIT; /* default */
if (strcmp(args[2], "reset_halt") == 0) if (strcmp(args[2], "reset_halt") == 0)
(*last_target_p)->reset_mode = RESET_HALT; {
LOG_WARNING("reset_mode argument is deprecated. reset_mode = reset_run");
}
else if (strcmp(args[2], "reset_run") == 0) else if (strcmp(args[2], "reset_run") == 0)
(*last_target_p)->reset_mode = RESET_RUN; {
LOG_WARNING("reset_mode argument is deprecated. reset_mode = reset_run");
}
else if (strcmp(args[2], "reset_init") == 0) else if (strcmp(args[2], "reset_init") == 0)
(*last_target_p)->reset_mode = RESET_INIT; {
LOG_WARNING("reset_mode argument is deprecated. reset_mode = reset_run");
}
else if (strcmp(args[2], "run_and_halt") == 0) else if (strcmp(args[2], "run_and_halt") == 0)
(*last_target_p)->reset_mode = RESET_RUN_AND_HALT; {
LOG_WARNING("reset_mode argument is deprecated. reset_mode = reset_run");
}
else if (strcmp(args[2], "run_and_init") == 0) else if (strcmp(args[2], "run_and_init") == 0)
(*last_target_p)->reset_mode = RESET_RUN_AND_INIT; {
LOG_WARNING("reset_mode argument is deprecated. reset_mode = reset_run");
}
else else
{ {
/* Kludge! we want to make this reset arg optional while remaining compatible! */ /* Kludge! we want to make this reset arg optional while remaining compatible! */
@ -1800,8 +1813,7 @@ int handle_soft_reset_halt_command(struct command_context_s *cmd_ctx, char *cmd,
int handle_reset_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) int handle_reset_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{ {
target_t *target = get_current_target(cmd_ctx); target_t *target = get_current_target(cmd_ctx);
enum target_reset_mode reset_mode = target->reset_mode; enum target_reset_mode reset_mode = RESET_RUN;
enum target_reset_mode save = target->reset_mode;
LOG_DEBUG("-"); LOG_DEBUG("-");
@ -1842,9 +1854,6 @@ int handle_reset_command(struct command_context_s *cmd_ctx, char *cmd, char **ar
/* reset *all* targets */ /* reset *all* targets */
target_process_reset(cmd_ctx); target_process_reset(cmd_ctx);
/* Restore default reset mode for this target */
target->reset_mode = save;
return ERROR_OK; return ERROR_OK;
} }
@ -2862,7 +2871,7 @@ static int jim_array2mem(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
u32 v; u32 v;
const char *varname; const char *varname;
u8 buffer[4096]; u8 buffer[4096];
int i, n, e, retval; int i, n, e, retval;
/* argv[1] = name of array to get the data /* argv[1] = name of array to get the data
* argv[2] = desired width * argv[2] = desired width