Before you start, make sure you have the following:
- Pico SDK already setup on the machine
- Environment variable PICO_SDK_PATH is setup correctly pointing to the location of pico sdk
- Also make sure you have downloaded and installed cmake
- You will also need to download libusb from https://github.com/libusb/libusb/releases
Follow the steps below to compile picotool
Open a command prompt and get
Get the latest verion of picotool from git
git clone -b master https://github.com/raspberrypi/picotool.git
navigate to the folder picotool
cd picotool
within the picotool folder create a directory called build
mkdir build
navigate to the build folder
cd build
use the following command to setup cmake
cmake -G "NMake Makefiles" -DLIBUSB_INCLUDE_DIR="<path to libusb header file (libusb.h)>" -DLIBUSB_LIBRARIES="<path to libusb>\libusb-1.0.lib" ..
In my case I have my libusb in the folder C:\DevelopmentTools\libusb-1.0.24, so my cmake command looks like this:
cmake -G "NMake Makefiles" -DLIBUSB_INCLUDE_DIR="C:\DevelopmentTools\libusb-1.0.24\include\libusb-1.0" -DLIBUSB_LIBRARIES="C:\DevelopmentTools\libusb-1.0.24\VS2019\MS32\dll\libusb-1.0.lib" ..
Once this is completed, use the nmake command to make picotool
nmake
Happy coding!