jtag: tcl: show error message when attempting manual "drscan" on a bypassed tap

To perform any meaningful manipulations with DR the corresponding IR should
be set to a relevant instruction, not BYPASS, so warn the user accordingly.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Change-Id: I42580ecd75ae824a4145f6f17f0df9bcf825b50f
Reviewed-on: https://review.openocd.org/c/openocd/+/7654
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
This commit is contained in:
Paul Fertser 2023-05-02 15:15:21 +03:00 committed by Antonio Borneo
parent 8d12ae796e
commit 3a4f445bd9
1 changed files with 5 additions and 0 deletions

View File

@ -116,6 +116,11 @@ COMMAND_HANDLER(handle_jtag_command_drscan)
return ERROR_COMMAND_ARGUMENT_INVALID;
}
if (tap->bypass) {
command_print(CMD, "Can't execute as the selected tap is in BYPASS");
return ERROR_FAIL;
}
tap_state_t endstate = TAP_IDLE;
if (CMD_ARGC > 3 && !strcmp("-endstate", CMD_ARGV[CMD_ARGC - 2])) {
const char *state_name = CMD_ARGV[CMD_ARGC - 1];