Skip to content

Instantly share code, notes, and snippets.

@shavaj
Last active August 14, 2022 07:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shavaj/30454a84903f1b69dd2c3a4097524cdb to your computer and use it in GitHub Desktop.
Save shavaj/30454a84903f1b69dd2c3a4097524cdb to your computer and use it in GitHub Desktop.
Compile picotool on Windows 10 using cmake

Compile picotool on Windows 10 using cmake

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment