endstate = TAP_IDLE;
- script_debug(interp, "drscan", argc, args);
+ script_debug(interp, argc, args);
/* validate arguments as numbers */
e = JIM_OK;
return JIM_ERR;
}
- script_debug(interp, "pathmove", argc, args);
+ script_debug(interp, argc, args);
int i;
for (i = 0; i < argc-1; i++) {
static int Jim_Command_flush_count(Jim_Interp *interp, int argc, Jim_Obj *const *args)
{
- script_debug(interp, "flush_count", argc, args);
+ script_debug(interp, argc, args);
Jim_SetResult(interp, Jim_NewIntObj(interp, jtag_get_flush_queue_count()));
int e = jtag_init_inner(context);
if (e != ERROR_OK) {
Jim_Obj *eObj = Jim_NewIntObj(goi.interp, e);
+ Jim_IncrRefCount(eObj);
Jim_SetResultFormatted(goi.interp, "error: %#s", eObj);
- Jim_FreeNewObj(goi.interp, eObj);
+ Jim_DecrRefCount(goi.interp, eObj);
return JIM_ERR;
}
return JIM_OK;
if (e != ERROR_OK) {
Jim_Obj *eObj = Jim_NewIntObj(goi.interp, e);
+ Jim_IncrRefCount(eObj);
Jim_SetResultFormatted(goi.interp, "error: %#s", eObj);
- Jim_FreeNewObj(goi.interp, eObj);
+ Jim_DecrRefCount(goi.interp, eObj);
return JIM_ERR;
}
return JIM_OK;
while (tap) {
uint32_t expected, expected_mask, ii;
- snprintf(expected_id, sizeof expected_id, "0x%08x",
+ snprintf(expected_id, sizeof(expected_id), "0x%08x",
(unsigned)((tap->expected_ids_cnt > 0)
? tap->expected_ids[0]
: 0));
(unsigned int)(expected_mask));
for (ii = 1; ii < tap->expected_ids_cnt; ii++) {
- snprintf(expected_id, sizeof expected_id, "0x%08x",
+ snprintf(expected_id, sizeof(expected_id), "0x%08x",
(unsigned) tap->expected_ids[ii]);
if (tap->ignore_version)
expected_id[2] = '*';
return retval;
}
-COMMAND_HANDLER(handle_jtag_reset_command)
-{
- if (CMD_ARGC != 2)
- return ERROR_COMMAND_SYNTAX_ERROR;
-
- int trst = -1;
- if (CMD_ARGV[0][0] == '1')
- trst = 1;
- else if (CMD_ARGV[0][0] == '0')
- trst = 0;
- else
- return ERROR_COMMAND_SYNTAX_ERROR;
-
- int srst = -1;
- if (CMD_ARGV[1][0] == '1')
- srst = 1;
- else if (CMD_ARGV[1][0] == '0')
- srst = 0;
- else
- return ERROR_COMMAND_SYNTAX_ERROR;
-
- if (adapter_init(CMD_CTX) != ERROR_OK)
- return ERROR_JTAG_INIT_FAILED;
-
- jtag_add_reset(trst, srst);
- return jtag_execute_queue();
-}
-
COMMAND_HANDLER(handle_runtest_command)
{
if (CMD_ARGC != 1)
return ERROR_FAIL;
}
- int field_size = tap->ir_length;
- fields[i].num_bits = field_size;
- uint8_t *v = malloc(DIV_ROUND_UP(field_size, 8));
-
uint64_t value;
retval = parse_u64(CMD_ARGV[i * 2 + 1], &value);
if (ERROR_OK != retval)
goto error_return;
+
+ int field_size = tap->ir_length;
+ fields[i].num_bits = field_size;
+ uint8_t *v = calloc(1, DIV_ROUND_UP(field_size, 8));
+ if (!v) {
+ LOG_ERROR("Out of memory");
+ goto error_return;
+ }
+
buf_set_u64(v, 0, field_size, value);
fields[i].out_value = v;
fields[i].in_value = NULL;
.help = "print current scan chain configuration",
.usage = ""
},
- {
- .name = "jtag_reset",
- .handler = handle_jtag_reset_command,
- .mode = COMMAND_EXEC,
- .help = "Set reset line values. Value '1' is active, "
- "value '0' is inactive.",
- .usage = "trst_active srst_active",
- },
{
.name = "runtest",
.handler = handle_runtest_command,
.name = "irscan",
.handler = handle_irscan_command,
.mode = COMMAND_EXEC,
- .help = "Execute Instruction Register (DR) scan. The "
+ .help = "Execute Instruction Register (IR) scan. The "
"specified opcodes are put into each TAP's IR, "
"and other TAPs are put in BYPASS.",
.usage = "[tap_name instruction]* ['-endstate' state_name]",