Certain OpenOCD commands have been deprecated/removed during the various revisions.
@itemize @bullet
-@item @b{load_binary}
-@cindex load_binary
-@*use @option{load_image} command with same args. @xref{load_image}.
-@item @b{target}
-@cindex target
-@*@option{target} no longer take the reset_init, reset_run, run_and_halt, run_and_init. The @option{reset} command
-always does a @option{reset run} when passed no arguments.
+@item @b{arm7_9 fast_writes}
+@cindex arm7_9 fast_writes
+@*use @option{arm7_9 fast_memory_access} command with same args. @xref{arm7_9 fast_memory_access}.
+@item @b{arm7_9 force_hw_bkpts}
+@cindex arm7_9 force_hw_bkpts
+@*Use @option{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}
+@cindex arm7_9 sw_bkpts
+@*On by default. See also @option{gdb_breakpoint_override}. @xref{gdb_breakpoint_override}.
+@item @b{daemon_startup}
+@cindex 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}
@cindex dump_binary
@*use @option{dump_image} command with same args. @xref{dump_image}.
@item @b{flash write_binary}
@cindex flash write_binary
@*use @option{flash write_bank} command with same args. @xref{flash write_bank}.
-@item @b{arm7_9 fast_writes}
-@cindex arm7_9 fast_writes
-@*use @option{arm7_9 fast_memory_access} command with same args. @xref{arm7_9 fast_memory_access}.
@item @b{flash auto_erase}
@cindex flash auto_erase
@*use @option{flash write_image} command passing @option{erase} as the first parameter. @xref{flash write_image}.
-@item @b{daemon_startup}
-@cindex 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{arm7_9 sw_bkpts}
-@cindex arm7_9 sw_bkpts
-@*On by default. See also @option{gdb_breakpoint_override}. @xref{gdb_breakpoint_override}.
-@item @b{arm7_9 force_hw_bkpts}
-@cindex arm7_9 force_hw_bkpts
-@*Use @option{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{load_binary}
+@cindex load_binary
+@*use @option{load_image} command with same args. @xref{load_image}.
@item @b{run_and_halt_time}
@cindex run_and_halt_time
@*This command has been removed for simpler reset behaviour, it can be simulated with the
sleep 100
halt
@end smallexample
+@item @b{target} <@var{type}> <@var{endian}> <@var{jtag-position}>
+@cindex target
+@*use the create subcommand of @option{target}.
+@item @b{target_script} <@var{target#}> <@var{eventname}> <@var{scriptname}>
+@cindex target_script
+@*use <@var{target_name}> configure -event <@var{eventname}> "script <@var{scriptname}>"
+@item @b{working_area}
+@cindex 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
return [target number [expr [target count] - 1 ]]
}
-
-proc target_script {target_num eventname scriptname} {
-
- set tname [target number $target_num]
-
- if { 0 == [string compare $eventname "reset"] } {
- $tname configure -event reset-init "script $scriptname"
- return
- }
-
- if { 0 == [string compare $eventname "post_reset"] } {
- $tname configure -event reset-init "script $scriptname"
- return
- }
-
- if { 0 == [string compare $eventname "pre_reset"] } {
- $tname configure -event reset-start "script $scriptname"
- return
- }
-
- if { 0 == [string compare $eventname "gdb_program_config"] } {
- $tname configure -event old-gdb_program_config "script $scriptname"
- return
- }
-
- return -code error "Unknown target (old) event: $eventname (try $tname configure -event NAME)"
-
-}
-
-add_help_text target_script "DEPRECATED please see the new TARGETNAME configure -event interface"
-
# Try flipping / and \ to find file if the filename does not
# match the precise spelling
proc find {filename} {
}
add_help_text production "Runs test procedure. Throws exception if procedure failed. Prints progress messages. Implement in target script."
-proc load {args} {
- return [eval "load_image $args"]
-}
-add_help_text load "synonym to load_image"
-
-proc verify {args} {
- return [eval "verify_image $args"]
-}
-
-add_help_text verify "synonym to verify_image"
-
-
-
add_help_text cpu "<name> - prints out target options and a comment on CPU which matches name"
# A list of names of CPU and options required
int handle_targets_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-int handle_working_area_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-
int handle_reg_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
int handle_poll_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
int handle_halt_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
{
register_command(cmd_ctx, NULL, "targets", handle_targets_command, COMMAND_EXEC, "change the current command line target (one parameter) or lists targets (with no parameter)");
- register_command(cmd_ctx, NULL, "working_area", handle_working_area_command, COMMAND_ANY, "set a new working space");
register_command(cmd_ctx, NULL, "virt2phys", handle_virt2phys_command, COMMAND_ANY, "translate a virtual address into a physical address");
register_command(cmd_ctx, NULL, "profile", handle_profile_command, COMMAND_EXEC, "profiling samples the CPU PC");
return ERROR_OK;
}
-
-
-int handle_working_area_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
-{
- int retval = ERROR_OK;
- target_t *target = NULL;
-
- if ((argc < 4) || (argc > 5))
- {
- return ERROR_COMMAND_SYNTAX_ERROR;
- }
-
- target = get_target_by_num(strtoul(args[0], NULL, 0));
- if (!target)
- {
- return ERROR_COMMAND_SYNTAX_ERROR;
- }
- target_free_all_working_areas(target);
-
- target->working_area_phys = target->working_area_virt = strtoul(args[1], NULL, 0);
- if (argc == 5)
- {
- target->working_area_virt = strtoul(args[4], NULL, 0);
- }
- target->working_area_size = strtoul(args[2], NULL, 0);
-
- if (strcmp(args[3], "backup") == 0)
- {
- target->backup_working_area = 1;
- }
- else if (strcmp(args[3], "nobackup") == 0)
- {
- target->backup_working_area = 0;
- }
- else
- {
- LOG_ERROR("unrecognized <backup|nobackup> argument (%s)", args[3]);
- return ERROR_COMMAND_SYNTAX_ERROR;
- }
-
- return retval;
-}
-
-
// every 300ms we check for reset & powerdropout and issue a "reset halt" if
// so.
int x,r,e;
jim_wide w;
struct command_context_s *cmd_ctx;
- const char *cp;
target_t *target;
Jim_GetOptInfo goi;
enum tcmd {
return JIM_ERR;
}
- /* is this old syntax? */
- /* To determine: We have to peek at argv[0]*/
- cp = Jim_GetString( goi.argv[0], NULL );
- for( x = 0 ; target_types[x] ; x++ ){
- if( 0 == strcmp(cp,target_types[x]->name) ){
- break;
- }
- }
- if( target_types[x] ){
- /* YES IT IS OLD SYNTAX */
- Jim_Obj *new_argv[10];
- int new_argc;
-
- /* target_old_syntax
- *
- * It appears that there are 2 old syntaxes:
- *
- * target <typename> <endian> <chain position> <variant>
- *
- * and
- *
- * target <typename> <endian> <reset mode> <chain position> <variant>
- *
- */
-
- /* The minimum number of arguments is 4 */
- if( argc < 4 ){
- Jim_WrongNumArgs( interp, 1, argv, "[OLDSYNTAX] ?TYPE? ?ENDIAN? ?CHAIN-POSITION? ?VARIANT?");
- return JIM_ERR;
- }
-
- /* the command */
- new_argv[0] = argv[0];
- new_argv[1] = Jim_NewStringObj( interp, "create", -1 );
- {
- char buf[ 30 ];
- sprintf( buf, "target%d", new_target_number() );
- new_argv[2] = Jim_NewStringObj( interp, buf , -1 );
- }
- new_argv[3] = goi.argv[0]; /* typename */
- new_argv[4] = Jim_NewStringObj( interp, "-endian", -1 );
- new_argv[5] = goi.argv[1];
- new_argv[6] = Jim_NewStringObj( interp, "-chain-position", -1 );
-
- /* If goi.argv[2] is not a number, we need to skip it since it is the reset mode. */
- jim_wide w;
- int chain_position_argv = 2;
- if (JIM_ERR == Jim_GetWide(interp, goi.argv[chain_position_argv], &w)) {
- if (chain_position_argv + 1 < goi.argc) {
- chain_position_argv += 1;
- } else {
- Jim_WrongNumArgs( interp, 1, argv, "[OLDSYNTAX] ?TYPE? ?ENDIAN? ?RESET? ?CHAIN-POSITION? ?VARIANT?");
- return JIM_ERR;
- }
- }
-
- new_argv[7] = goi.argv[chain_position_argv];
-
- /* Only provide a variant configure option if there was a variant specified */
- if (chain_position_argv + 1 < goi.argc) {
- new_argv[8] = Jim_NewStringObj( interp, "-variant", -1 );
- new_argv[9] = goi.argv[chain_position_argv + 1];
- new_argc = 10;
- } else {
- new_argc = 8;
- }
-
- /*
- * new arg syntax:
- * argv[0] = command
- * argv[1] = create
- * argv[2] = cmdname
- * argv[3] = typename
- * argv[4] = -endian
- * argv[5] = little
- * argv[6] = -position
- * argv[7] = NUMBER
- * argv[8] = -variant
- * argv[9] = "somestring"
- */
-
- /* don't let these be released */
- for( x = 0 ; x < new_argc ; x++ ){
- Jim_IncrRefCount( new_argv[x]);
- }
- /* call our self */
- LOG_DEBUG("Target OLD SYNTAX - converted to new syntax");
-
- r = jim_target( goi.interp, new_argc, new_argv );
-
- /* release? these items */
- for( x = 0 ; x < new_argc ; x++ ){
- Jim_DecrRefCount( interp, new_argv[x] );
- }
- return r;
- }
-
//Jim_GetOpt_Debug( &goi );
r = Jim_GetOpt_Enum( &goi, target_cmds, &x );
if( r != JIM_OK ){