extern struct target_type dsp5680xx_target;
extern struct target_type testee_target;
extern struct target_type avr32_ap7k_target;
+extern struct target_type stm32_stlink_target;
static struct target_type *target_types[] =
{
&dsp5680xx_target,
&testee_target,
&avr32_ap7k_target,
+ &stm32_stlink_target,
NULL,
};
if (type->check_reset== NULL)
type->check_reset = default_check_reset;
+ assert(type->init_target != NULL);
+
int retval = type->init_target(cmd_ctx, target);
if (ERROR_OK != retval)
{
if (callback == NULL)
{
- return ERROR_INVALID_ARGUMENTS;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
if (*callbacks_p)
if (callback == NULL)
{
- return ERROR_INVALID_ARGUMENTS;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
if (*callbacks_p)
if (callback == NULL)
{
- return ERROR_INVALID_ARGUMENTS;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
while (c)
if (callback == NULL)
{
- return ERROR_INVALID_ARGUMENTS;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
while (c)
if (buffer == NULL)
{
LOG_ERROR("error allocating buffer for section (%d bytes)", (int)size);
- return ERROR_INVALID_ARGUMENTS;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
retval = target_read_buffer(target, address, size, buffer);
if (retval != ERROR_OK)
return ERROR_OK;
}
- command_print(CMD_CTX, "usage: reg <#|name> [value]");
-
- return ERROR_OK;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
COMMAND_HANDLER(handle_poll_command)
int retval = parse_uint(CMD_ARGV[0], &ms);
if (ERROR_OK != retval)
{
- command_print(CMD_CTX, "usage: %s [seconds]", CMD_NAME);
return ERROR_COMMAND_SYNTAX_ERROR;
}
// convert seconds (given) to milliseconds (needed)
return handle_bp_command_set(CMD_CTX, addr, asid, length, hw);
default:
- command_print(CMD_CTX, "usage: bp <address> [<asid>]<length> ['hw'|'hw_ctx']");
return ERROR_COMMAND_SYNTAX_ERROR;
}
}
break;
default:
- command_print(CMD_CTX, "usage: wp [address length "
- "[(r|w|a) [value [mask]]]]");
return ERROR_COMMAND_SYNTAX_ERROR;
}
.mode = COMMAND_EXEC,
.help = "loads active fast load image to current target "
"- mainly for profiling purposes",
+ .usage = "",
},
{
.name = "profile",
.handler = handle_profile_command,
.mode = COMMAND_EXEC,
+ .usage = "seconds filename",
.help = "profiling samples the CPU PC",
},
/** @todo don't register virt2phys() unless target supports it */
.name = "soft_reset_halt",
.handler = handle_soft_reset_halt_command,
.mode = COMMAND_EXEC,
+ .usage = "",
.help = "halt the target and do a soft reset",
},
{
.handler = handle_bp_command,
.mode = COMMAND_EXEC,
.help = "list or set hardware or software breakpoint",
- .usage = "usage: bp <address> [<asid>]<length> ['hw'|'hw_ctx']",
+ .usage = "<address> [<asid>]<length> ['hw'|'hw_ctx']",
},
{
.name = "rbp",