Hi all,
I want to use freedom-e-sdk for debugging the board by JTAG,I want to write a specific value to a particular data register,how can i do?
You can read the Getting Started Guide (https://www.sifive.com/documentation/boards/hifive1/hifive1-getting-started-guide/) , but basically you can run OpenOCD in one window:
make run_openocd BOARD=freedom-e300-hifive1
In another window, to debug demo_gpio program:
make run_gdb BOARD=freedom-e300-hifive1 PROGRAM=demo_gpio
Then you can use any GDB commands to debug. For example to set a memory location:
set {int}0x80000000 = 0xF00D
Excellent,Thanks for the details,Megan.
Also I want to ask you how the program can be upload into the board? I have knew can use the command "make upload PROGRAM=demo_gpio"to do it,but I want to know how the OpenOCD work link to the JTAG, and how the “openocd.cfg” and some other relevant script work.
I hope that I can understand the whole process of the JTAG debugger.
Best,
huangwanneng
Hi Huangwanneng, suggest that you first take a look at the RISC-V Debug Spec:
And then you can look at the implementation of OpenOCD here:
In particular, when the program is loaded to the SPI Flash, GDB’s load
command examines the ELF file, sees that it linked in the Flash region, then requests OpenOCD to uses the appropriate driver to program the SPI Flash. For Freedom E platforms, that’s the fespi
driver that we’ve also added to OpenOCD. OpenOCD is causing the processor to execute little code snippets to program the SPI Flash.