majbthrd / pico-debug

virtual debug pod for RP2040 "Raspberry Pi Pico" with no added hardware
379 stars 50 forks source link

openocd build for Mac Users #5

Closed citizenfish closed 3 years ago

citizenfish commented 3 years ago

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.

majbthrd commented 3 years ago

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

frederikvs commented 3 years ago

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.

ZontarOne commented 3 years ago

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.