0

I built an open source electronics project which requires me to program the board with jtag. I already had a Raspberry Pi 1 b+ so I decided to try and use it to do the programming. I can't seem to get OpenOCD working though. I am using an image provided by a helpful member on one of the forums.

When I try to run the command I get this...

pi@raspberrypi:~ $ openocd –f openocd-pi.conf
Open On-Chip Debugger 0.10.0+dev-00430-g06123153 (2018-06-09-16:18)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Unexpected command line argument: –f

I thought maybe the image was bad, so I tried using a fresh Raspbian (or whatever the call it now) image and manually compile it myself. That was a waste of time, same result. Now back on the premade image wondering what I am doing wrong.

Thanks, Chris

2 Answers 2

1

It's next to impossible to say for sure what is wrong with a self-compiled binary. Try installing an official version, e.g. for Buster there's https://packages.debian.org/buster/openocd

If there's a reason you must use the binary you have, you may want to try using -c "script openocd-pi.conf" instead of -f openocd-pi.conf. Double check the syntax using the man page for your version.

0

The build date (2018-06-09) on that binary is from before some major (good) changes were made to openocd. The raspbian source image is probably from the same version you had the binary for.

My suggestion is to get the source from git and compile it yourself:

git clone git://git.code.sf.net/p/openocd/code openocd
cd openocd
./bootstrap
declare options="--enable-ftdi --enable-ft232r"
options="$options --enable-buspirate --enable-bcm2835gpio --enable-sysfsgpio"
options="$options --disable-armjtagew"
options="$options --disable-dummy --disable-stlink --disable-ti-icdi --disable-ulink --disable-usb-blaster-2 --disable-vsllink --disable-xds110 --disable-osbdm --disable-opendous --disable-aice --disable-usbprog --disable-rlink --disable-cmsis-dap --disable-kitprog --disable-usb-blaster --disable-presto --disable-openjtag --disable-jlink --disable-parport --disable-parport-ppdev --disable-parport-giveio --disable-jtag_vpi --disable-amtjtagaccel --disable-zy1000-master --disable-zy1000 --disable-ioutil --disable-imx_gpio --disable-ep93xx --disable-at91rm9200 --disable-gw16012 --disable-oocd_trace --disable-xlnx-pcie-xvc --disable-minidriver-dummy"
options="$options --disable-werror"
./configure --prefix=/usr $options
nice make
sudo nice make install

All the --disable options are to speed the build process. Re-enable just the ones you need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.