This is an automated email from Gerrit. "Tomas Vanek <van...@fbl.cz>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8745
-- gerrit commit 7204e0f494fb8f11afdbaf1a14830566b5a47de9 Author: Tomas Vanek <van...@fbl.cz> Date: Sat Feb 8 22:00:40 2025 +0100 drivers/ch347: don't loose swd_read/write_reg errors SWD read_reg() and write_reg() methods are declared with void return. Save the error code to ch347_swd_context.queued_retval (will be returned later by SWD run method) instead of ignoring it. Change-Id: Ib95a1bc3398712ac2f8520c79d281633d75f0335 Signed-off-by: Tomas Vanek <van...@fbl.cz> diff --git a/src/jtag/drivers/ch347.c b/src/jtag/drivers/ch347.c index 8b780b3cfe..6c7ded1595 100644 --- a/src/jtag/drivers/ch347.c +++ b/src/jtag/drivers/ch347.c @@ -2296,13 +2296,17 @@ static int ch347_swd_switch_seq(enum swd_special_seq seq) static void ch347_swd_read_reg(uint8_t cmd, uint32_t *value, uint32_t ap_delay_clk) { assert(cmd & SWD_CMD_RNW); - ch347_swd_queue_cmd(cmd, value, 0, ap_delay_clk); + int retval = ch347_swd_queue_cmd(cmd, value, 0, ap_delay_clk); + if (retval != ERROR_OK) + ch347_swd_context.queued_retval = retval; } static void ch347_swd_write_reg(uint8_t cmd, uint32_t value, uint32_t ap_delay_clk) { assert(!(cmd & SWD_CMD_RNW)); - ch347_swd_queue_cmd(cmd, NULL, value, ap_delay_clk); + int retval = ch347_swd_queue_cmd(cmd, NULL, value, ap_delay_clk); + if (retval != ERROR_OK) + ch347_swd_context.queued_retval = retval; } static const struct swd_driver ch347_swd = { --