For all we know, the Fedora package building machinery may be packaging a version of OpenOCD from 1982 and will continue to do so until it detects a version number change.
git clone https://github.com/openocd-org/openocd.gitThis article (from April, 2025) suggests building from source and says that it is simple and quick to do so. I do this:
cd openocd ./bootstrapIt tells me I am missing something called "libtoolize". I get it via:
su dnf -y install libtoolNext we try:
./configureIt complains that it cannot find "jimtcl".
dnf -y jimtcl-develNow ./configure works, but I see these warnings:
warning: Ignoring macrofiles at /home/tom/.rpmrc:2 configure: WARNING: libusb-1.x not found, trying legacy libusb-0.1 as a fallback; consider installing libusb-1.x insteadThere has always been confusion and stupid nonsense regarding libusb. I am just going to ignore this warning. I don't see anything called "libusb-1.x" in the Fedora package set.
At the end of ./configure it spits out a big list of configuration with yes/no status, including:
ST-Link Programmer no SEGGER J-Link Programmer noBoth of which I like to use and have used in the past. We will press on for the time being.
makeThis seemed to go "OK". Before typing "make install", I should use dnf to remove the fedora package.
But I don't. I try running the Fedora package version and now it just works! I wanted to run it to reproduce the error I was getting and document the issue, but that is no longer relevant. At least not for now.
As always, I expect any mysterious problem that "fixes itself" to crop up again at some unpredictable future time, no doubt when it will cause the most trouble.
cd /Projects/OpenOCD git clone https://github.com/raspberrypi/openocd.git mv openocd rpi cd rpi ./bootstrap ./configure --enable-picoprobe make -j4At this point we could "su ; make install" -- and maybe we should, but in any case we should uninstall the Fedora openocd first. I do this:
su dnf remove openocd dnf -y install capstone make installI don't know what capstone is, but the Fedora openocd required it and maybe the raspberry pi fork does also.
./configure --enable-hamboneIt accepts this as well as it did --enable-picoprobe. Apparently "picoprobe" is not a supported adapter -- nor is "hambone".
./configure --enable-cmsis-dapAnd this gives the error:
configure: error: hidapi is required for adapter "CMSIS-DAP v1 compliant dongle (HID)".
cd /Projects/OpenOCD/rpi git branch * rpi-common git branch -a * rpi-common remotes/origin/HEAD -> origin/rpi-common remotes/origin/libgpiodv2 remotes/origin/lurch-patch-1 remotes/origin/master remotes/origin/master+rp2040 remotes/origin/master+swd+rp2040+picoprobe remotes/origin/master+swdetc remotes/origin/picoprobe remotes/origin/picoprobe_tmp remotes/origin/rp2040-0.12-rc2 remotes/origin/rp2040-master remotes/origin/rp2040-v0.11.0-test remotes/origin/rp2040-v0.12.0 remotes/origin/rpi-common remotes/origin/sdk-2.0.0 remotes/origin/tcl-core0-default remotes/origin/upstream-v0.12.0-masterSo, I have many choices. I try this:
git switch picoprobe branch 'picoprobe' set up to track 'origin/picoprobe'. Switched to a new branch 'picoprobe' make clean ./bootstrap ./configure --enable-picoprobeThis fails as follows:
configure: WARNING: libusb-1.x not found, trying legacy libusb-0.1 as a fallback; consider installing libusb-1.x instead checking for libusb... no configure: error: libusb-1.x is required for the Raspberry Pi Pico ProbeSo, on one hand it says it will try libusb-0.1 as a fallback, but later insists that I must have libusb-1.x -- I try this:
dnf install libusb1-develThis fixes the problem and here is part of the summary when it finishes:
Raspberry Pi Pico Probe yes ST-Link Programmer yes (auto) Versaloon-Link JTAG Programmer yes (auto) CMSIS-DAP v2 Compliant Debugger yes (auto) CMSIS-DAP Compliant Debugger noAsking for cmsis-dap gives me the complain about "hidapi", but I do have the v2 flavor (if I care) and maybe that will do if I need it.
The compile gets errors:
src/jtag/drivers/ulink.c:1491:50: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] 1491 | tdo_buffer_start = calloc(sizeof(uint8_t), scan_size_bytes);I try this:
./configure --enable-picoprobe --disable-ulink makeAnd now I get this error:
src/flash/nor/ambiqmicro.c:152:41: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] 152 | ambiqmicro_info = calloc(sizeof(struct ambiqmicro_flash_bank), 1);The same error in a different file. It is strange that a compiler error regarding calloc() calls is triggering in both cases.
Tom's software pages / tom@mmto.org