riscv-openocd
riscv-openocd copied to clipboard
Loading programs with program buffer expects autoexec support (optional feature according to debug-spec 0.13)
Simple fix in "write_memory_progbuf" in riscv-013.c A check can be added to confirm if the support exists (by writing then reading back 0x18) and then based on that setting variable "setup_needed" as False in the first if-condition in the for-loop can be removed.
Hi Sujay,
Thank you for filing this ticket.
I can confirm this is a valid issue.
All bits in "abstractauto" DM registers are optional per the RISC-V Debug specification, and targets need not support it. However, the current OpenOCD code for both memory read and write via program buffer relies on the autoexecdata[0] bit - without checking if it is really supported.
Side note: Most targets appear to have autoexecdata[0] bit implemented, which is also recommended for performance reasons. That fact perhaps masked this issue in OpenOCD.
Thanks Jan, yes I agree. We have added autoexec support now.
I take it that this issue is still extant and awaiting a fix?
- https://github.com/riscv/riscv-openocd/blob/a01bd76e5c10eba8bc3481eb7552fb8feab79f91/src/target/riscv/riscv-013.c#L3990
I take it that this issue is still extant and awaiting a fix?
Yes, it is still relevant. Though IMHO it's a low priority one, since most hardware does support autoexec
AFAIK.