https://blog.smittytone.net/2021/02/02/program-raspberry-pi-pico-c-mac/
Needed tools for cross compilation.
brew install cmake
brew tap ArmMbed/homebrew-formulae
brew install arm-none-eabi-gcc
git clone -b master --recurse-submodules https://github.com/raspberrypi/pico-sdk.git
sudo stty 115200 -F /dev/ttyAMA0
sudo cat /dev/ttyAMA0
git clone https://github.com/raspberrypi/openocd.git --recursive --branch rp2040 --depth=1
cd openocd
./bootstrap
./configure
make -j4
sudo make install
OpenOCD should run on Raspberry Pi, so local GDB can connect to it.
openocd -f interface/raspberrypi-swd.cfg -f target/rp2040.cfg -c "bindto 0.0.0.0"