From: OpenOCD-Gerrit <ope...@us...> - 2022-05-01 04:49:21
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 66335683fec62ac89da48d64932fd9d082314225 (commit) from 12d1ad0c75298d56827debcacc83c679bfbe9ac2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 66335683fec62ac89da48d64932fd9d082314225 Author: jihongbin <lo...@or...> Date: Fri Apr 29 17:03:15 2022 +0800 drivers/cmsis-dap: Correct the DAP protocol parameter parsing error Fixes: 01030fb89354 (drivers/cmsis-dap: tidy up buffer access) Change-Id: Id192d3930a89980d641058b6444d12caec19ce6f Signed-off-by: Hongbin Ji <lo...@or...> Reviewed-on: https://review.openocd.org/c/openocd/+/6954 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: jihongbin <jh...@16...> diff --git a/src/jtag/drivers/cmsis_dap.c b/src/jtag/drivers/cmsis_dap.c index 63407be42..eaa65abc6 100644 --- a/src/jtag/drivers/cmsis_dap.c +++ b/src/jtag/drivers/cmsis_dap.c @@ -1405,18 +1405,18 @@ static void debug_parse_cmsis_buf(const uint8_t *cmd, int cmdlen) for (int i = 0; i < cmdlen; ++i) printf(" %02x", cmd[i]); printf("\n"); - switch (cmd[1]) { + switch (cmd[0]) { case CMD_DAP_JTAG_SEQ: { - printf("cmsis-dap jtag sequence command %02x (n=%d)\n", cmd[1], cmd[2]); + printf("cmsis-dap jtag sequence command %02x (n=%d)\n", cmd[0], cmd[1]); /* - * #2 = number of sequences - * #3 = sequence info 1 - * #4...4+n_bytes-1 = sequence 1 + * #1 = number of sequences + * #2 = sequence info 1 + * #3...4+n_bytes-1 = sequence 1 * #4+n_bytes = sequence info 2 * #5+n_bytes = sequence 2 (single bit) */ - int pos = 3; - for (int seq = 0; seq < cmd[2]; ++seq) { + int pos = 2; + for (int seq = 0; seq < cmd[1]; ++seq) { uint8_t info = cmd[pos++]; int len = info & DAP_JTAG_SEQ_TCK; if (len == 0) ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/cmsis_dap.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) hooks/post-receive -- Main OpenOCD repository |