Skip to content

OpenOCD for sc_riscv32

Pavel S. Smirnov edited this page Mar 2, 2017 · 13 revisions

Prerequisites

Packages

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

OpenOCD

Clone OpenOCD

See http://elinux.org/Compiling_OpenOCD

Clone any available repository to working directory

git clone -b syntacore_riscv32i --recursive https://github.com/syntacore/openocd.git openocd

Build OpenOCD

Go to working directory and create Makefile

./bootstrap
./configure --enable-maintainer-mode --disable-werror --enable-ftdi

Invoke the make

nice make -j

Install OpenOCD

If build is successful, you can install OpenOCD and headers

sudo make install

To deinstall library and headers

sudo make uninstall

OpenOCD run

Run 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.log

After initialization OpenOCD waiting for command from the network.

OpenOCD remote session

Run telnet application in other console:

telnet localhost 4444

Print help to show list of commands. For example:

targets sc_rv32i0.cpu
halt
load_image /home/tools32i/test/scr5-baremetal-example/build/scr-test.elf
resume 0x200
halt
shutdown

Enter the shutdown command to close remote OpenOCD application.

Clone this wiki locally