majbthrd/pico-debug

openocd build for Mac Users

citizenfish opened this issue · 3 comments

Firstly thanks for all the good work here

Just wanted to add some extra notes for Mac users following your openocd build notes

If you get the error:-

configure: error: hidapi is required for the CMSIS-DAP Compliant Debugger

Then take the following steps:-

git clone https://github.com/signal11/hidapi.git
cd hidapi
./bootstrap
./configure --enable-static --disable-shared
make

export HIDAPI_LIBS="-L`pwd`/mac/.libs -lhidapi"
export PKG_CONFIG_PATH="`pwd`/pc"

Then change back to the openocd directory and configure as per your instructions.
The environment variables above will ensure that hidapi is found and linked.

That is much appreciated! I have revised howto/openocd.md to link to this page.

FYI : on my Mac I've also had to change the config command for openocd to

./configure --enable-cmsis-dap CFLAGS="-Wno-deprecated -Wno-strict-prototypes"

Apparently the compiler on some Macs is more sensitive to certain types of warnings.

I also had to include hidapi headers before configuring openocd:

 export HIDAPI_CFLAGS="-I /`pwd`/hidapi"

then ./configure ... openocd works.

Before compiling with make I had to install texinfo

brew install texinfo
export PATH="/usr/local/opt/texinfo/bin:$PATH"

and run make -j8 again.
Then it works without errors.