-
Notifications
You must be signed in to change notification settings - Fork 6
OpenOCD for sc_riscv32
You will need to install several packages to compile and run OpenOCD. Open a terminal window and type:
sudo apt-get install make libtool autoconf texinfo libusb-dev doxygen
Clone any available repository to working directory
git clone -b syntacore_riscv32i --recursive https://github.com/syntacore/openocd.gitSee http://elinux.org/Compiling_OpenOCD
Go to working directory and create Makefile
./bootstrap
./configure --enable-maintainer-mode --disable-werror --enable-ftdiInvoke the make
touch src/openocd.c && time nice make -jCall of touch src/openocd.c updates build timestamp and git version
$ src/openocd --version
Open On-Chip Debugger 0.10.0+dev-00920-g98813c7 (2017-08-22-18:02)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
If build is successful, you can install OpenOCD and headers
sudo make installTo deinstall library and headers
sudo make uninstallRun OpenOCD as TCP server with selected configuration files (even without install).
Use sudo if policy for your USB device is not configured.
For example ./tcl folder contains set of configuration files, using olimex-arm-usb-ocd interface for syntacore_riscv32i 2 TAPs target:
sudo src/openocd -f tcl/interface/ftdi/olimex-arm-usb-ocd.cfg -f tcl/target/syntacore_riscv32i_2tap.cfg |& tee ocd.logAfter initialization OpenOCD waiting for command from the network.
Run telnet application in other console:
telnet localhost 4444Print help to show list of commands.
For example:
# show targets (usually last configured target is current core)
targets
# set core #0 as current core (usually for multicore configuration all but #0 cores are in parking state)
targets sc_rv32i0.cpu
# halt core (debug mode state)
halt
# load some elf image to memory
load_image /home/tools32i/test/scr5-baremetal-example/build/scr-test.elf
# resume execution from elf start address
resume 0x200
# halt core (if you need to examine registers or memory)
halt
# shutdown openocd server
shutdown