riscv-openocd icon indicating copy to clipboard operation
riscv-openocd copied to clipboard

hello,may i ask,this project just for debug riscv chip or this tools can be run on a riscv64 board?

Open lgkgkfg opened this issue 2 years ago • 1 comments

I want to use may riscv64 board to run openocd,is this project can be use for this ?

lgkgkfg avatar Sep 19 '22 09:09 lgkgkfg

OpenOCD is for cross/remote debugging from a debug host (usually running Windows, Linux, MacOS, FreeBSD etc.) against a RISC-V (or many other CPU/MCU targets) target board using JTAG (and some other debug protocols/mechanisms). I guess that the host debug platform could also be RISC-V (e.g. running Linux) with OpenOCD built to run on that system but debugging a separate RISC-V target via JTAG. But I'm not sure if that's ever been done? So OpenOCD is compiled to run on the relevant debug host OS and supports cross/remote debugging of the target system (including RISC-V systems) using JTAG (and some other debug mechanisms). OpenOCD provides a gdb Remote Serial Protocol server that gdb communicates with for debugging and OpenOCD translates Remote Serial Protocol interactions into JTAG (or other debug mechanism/protocol) exchanges with the debug target system.

However if you want to debug ON a RISC-V platform then you could run Linux (or another OS) on that RISC-V platform and use gdb to debug user applications there.

It probably wouldn't really make sense to run OpenOCD on the RISC-V platform for debugging because there would be no JTAG connection needed to debug on the platform itself. If the RISC-V platform is running bare metal or an RTOS then I don't think that there's any option other than to run OpenOCD on a separate debug host and debug remotely over JTAG.

Hope that makes sense? It might be worth reading the OpenOCD documentation to understand the purpose of and rationale for OpenOCD. And also the gdb remote debugging documentation.

  • https://openocd.org/pages/documentation.html
  • https://sourceware.org/gdb/current/onlinedocs/gdb/Remote-Debugging.html#Remote-Debugging

It's probably also pertinent to ask what is the nature of your RISC-V target? OS based? Linux? Other? Or bare metal/RTOS? Which RTOS if applicable? Answering these questions will help to refine answers/comments to your specific needs.

TommyMurphyTM1234 avatar Sep 19 '22 10:09 TommyMurphyTM1234

Candidate for closure?

TommyMurphyTM1234 avatar Oct 19 '22 22:10 TommyMurphyTM1234