X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Farm_tpiu_swo.c;h=bfe9081425ebe5bae82c89be59360317ea5f21e7;hb=2586fec922ae9ea9bea345f40598e0367934d22c;hp=8b1d012eda13e5ac9793e30cc210686b35bcfb82;hpb=7b504370f732a00d803163cab2b1750bde1927cf;p=openocd.git diff --git a/src/target/arm_tpiu_swo.c b/src/target/arm_tpiu_swo.c index 8b1d012eda..bfe9081425 100644 --- a/src/target/arm_tpiu_swo.c +++ b/src/target/arm_tpiu_swo.c @@ -155,7 +155,7 @@ static int arm_tpiu_swo_poll_trace(void *priv) if (obj->out_filename && obj->out_filename[0] == ':') list_for_each_entry(c, &obj->connections, lh) if (connection_write(c->connection, buf, size) != (int)size) - retval = ERROR_FAIL; + LOG_ERROR("Error writing to connection"); /* FIXME: which connection? */ return ERROR_OK; } @@ -678,6 +678,10 @@ static int jim_arm_tpiu_swo_enable(Jim_Interp *interp, int argc, Jim_Obj *const if (obj->pin_protocol == TPIU_SPPR_PROTOCOL_SYNC) { retval = wrap_read_u32(target, tpiu_ap, obj->spot.base + TPIU_SSPSR_OFFSET, &value); + if (retval != ERROR_OK) { + LOG_ERROR("Cannot read TPIU register SSPSR"); + return JIM_ERR; + } if (!(value & BIT(obj->port_width - 1))) { LOG_ERROR("TPIU does not support port-width of %d bits", obj->port_width); return JIM_ERR; @@ -880,9 +884,10 @@ static int arm_tpiu_swo_create(Jim_Interp *interp, struct arm_tpiu_swo_object *o assert(cmd_ctx); /* does this command exist? */ - cmd = Jim_GetCommand(interp, Jim_NewStringObj(interp, obj->name, -1), JIM_ERRMSG); + cmd = Jim_GetCommand(interp, Jim_NewStringObj(interp, obj->name, -1), JIM_NONE); if (cmd) { - Jim_SetResultFormatted(interp, "Command: %s Exists", obj->name); + Jim_SetResultFormatted(interp, "cannot create TPIU object because a command with name '%s' already exists", + obj->name); return JIM_ERR; } @@ -911,7 +916,7 @@ static int jim_arm_tpiu_swo_create(Jim_Interp *interp, int argc, Jim_Obj *const struct jim_getopt_info goi; jim_getopt_setup(&goi, interp, argc - 1, argv + 1); if (goi.argc < 1) { - Jim_WrongNumArgs(goi.interp, 1, goi.argv, "?name? ..options..."); + Jim_WrongNumArgs(interp, 1, argv, "name ?option option ...?"); return JIM_ERR; } @@ -1156,7 +1161,7 @@ static const struct command_registration arm_tpiu_swo_subcommand_handlers[] = { .name = "create", .mode = COMMAND_ANY, .jim_handler = jim_arm_tpiu_swo_create, - .usage = "name [-dap dap] [-ap-num num] [-address baseaddr]", + .usage = "name [-dap dap] [-ap-num num] [-baseaddr baseaddr]", .help = "Creates a new TPIU or SWO object", }, {