This is an automated email from Gerrit.

"Samuel Obuch <[email protected]>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9312

-- gerrit

commit 40a2e24135a71c5153fcd357de13860dcb16aaa5
Author: Samuel Obuch <[email protected]>
Date:   Thu Dec 11 15:15:27 2025 +0100

    target/riscv: fix riscv exec_progbuf for SMP targets
    
    Currently, 'riscv exec_progbuf' command does not select active target.
    So with multiple harts with a common debug module, program buffer may
    be executed on an incorrect target.
    
    Change-Id: Ic345b09b039c2b1e37e5b99a8534833ac2723277
    Signed-off-by: Samuel Obuch <[email protected]>

diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c
index 6fa5e025be..2463dd599a 100644
--- a/src/target/riscv/riscv-013.c
+++ b/src/target/riscv/riscv-013.c
@@ -5430,6 +5430,8 @@ static int riscv013_invalidate_cached_progbuf(struct 
target *target)
 
 static int riscv013_execute_progbuf(struct target *target, uint32_t *cmderr)
 {
+       if (dm013_select_target(target) != ERROR_OK)
+               return ERROR_FAIL;
        uint32_t run_program = 0;
        run_program = set_field(run_program, AC_ACCESS_REGISTER_AARSIZE, 2);
        run_program = set_field(run_program, AC_ACCESS_REGISTER_POSTEXEC, 1);

-- 

Reply via email to