From 203d68544b5fe4858854c06df66e1142d12b27bd Mon Sep 17 00:00:00 2001 From: Alex Suykov Date: Wed, 9 Sep 2020 23:47:58 +0300 Subject: [PATCH] Fix reg_offset handling in stlink_usb_read_all_regs --- src/stlink-lib/usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stlink-lib/usb.c b/src/stlink-lib/usb.c index f9b4775f3..9726ddc4a 100644 --- a/src/stlink-lib/usb.c +++ b/src/stlink-lib/usb.c @@ -754,7 +754,7 @@ int _stlink_usb_read_all_regs(stlink_t *sl, struct stlink_reg *regp) { sl->q_len = (int)size; stlink_print_data(sl); - for (i = reg_offset; i < 16; i++) regp->r[i] = read_uint32(sl->q_buf, i * 4); + for (i = 0; i < 16; i++) regp->r[i] = read_uint32(sl->q_buf, reg_offset + i * 4); regp->xpsr = read_uint32(sl->q_buf, reg_offset + 64); regp->main_sp = read_uint32(sl->q_buf, reg_offset + 68);