This is an automated email from Gerrit. "Kirill Radkin <kirill.rad...@syntacore.com>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7740
-- gerrit commit e357fb408cf6c270a70882321a35ccfd3361003c Author: Kirill Radkin <kirill.rad...@syntacore.com> Date: Fri Jun 16 10:02:12 2023 +0300 OpenOCD fails on assert during run "drscan" command OpenOCD fails if all TAPS are in BYPASS mode. Now in this case "drscan" fails with corresponding error. Change-Id: I27f65fb28e02ad2972be629e4f1b5c69dbffbe93 Signed-off-by: Kirill Radkin <kirill.rad...@syntacore.com> diff --git a/src/jtag/drivers/driver.c b/src/jtag/drivers/driver.c index 409b800874..c6af56bc1d 100644 --- a/src/jtag/drivers/driver.c +++ b/src/jtag/drivers/driver.c @@ -110,12 +110,21 @@ int interface_jtag_add_dr_scan(struct jtag_tap *active, int in_num_fields, /* count devices in bypass */ size_t bypass_devices = 0; + size_t all_devices = 0; for (struct jtag_tap *tap = jtag_tap_next_enabled(NULL); tap; tap = jtag_tap_next_enabled(tap)) { + all_devices++; + if (tap->bypass) bypass_devices++; } + if (all_devices == bypass_devices) { + LOG_ERROR("At least one TAP shouldn't be in BYPASS mode"); + + return ERROR_FAIL; + } + struct jtag_command *cmd = cmd_queue_alloc(sizeof(struct jtag_command)); struct scan_command *scan = cmd_queue_alloc(sizeof(struct scan_command)); struct scan_field *out_fields = cmd_queue_alloc((in_num_fields + bypass_devices) * sizeof(struct scan_field)); --