Skip to content

Instantly share code, notes, and snippets.

@koron
Last active August 27, 2022 02:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koron/5a882f80726308691050ee40ce6ff54b to your computer and use it in GitHub Desktop.
Save koron/5a882f80726308691050ee40ce6ff54b to your computer and use it in GitHub Desktop.
Compile picotool with MSYS2/MINGW64

まだ動作チェックしてないので暫定

picotool info -a でBOOTSELモードで繋いだpicoからデータを取れたので、動くことは確認。 RP2 Boolデバイスにlibusb-win32ドライバーをインストールする必要があった。

参照: https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf

$ cmake -B build -DCMAKE_DEPENDS_USE_COMPILER=OFF -DLIBUSB_INCLUDE_DIR=/mingw64/include/libusb-1.0

$ make -j8 -C build

cmakeとかgccとかlibusbはMSYS2/MINGW64でインストールしてある前提

libusbを自動検出に任せると、mingw64によるドライブレターを含めた絶対パスを、 MSYS2 cmakeが相対パスとして誤認しちゃうので、強制的に指定する必要があった。

cmake自体もMINGW64のを使えばよいかも。

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