Here are some notes and shell scripts for installing and using Pico C/C++ SDK 2.1.1 on MSYS2 on Windows. I searched a bit and found one partial guide on installing the SDK on MSYS2 [1], so I adapted and extended it.
[1] Setup Raspberry PI Pico SDK in 5 minutes
https://gist.github.com/thewh1teagle/70 ... 4b0ae31f69
MSYS2 does have a picotool binary package, so some folks may be using the SDK on MSYS2 just fine. But I couldn't find any complete guides... anyway I got it done myself, the MSYS2 cmake reported some warnings but otherwise building stuff works almost like the Linux Mint setup that I was using. Also got picotool and pioasm built and installed.
Notes and shell scripts are in the attached archive. The notes are reproduced below for convenience, with some formatting adjustments.
Setup C/C++ SDK on MSYS2
========================
The following is based on the work of thewh1teagle at:
https://gist.github.com/thewh1teagle/70 ... 4b0ae31f69
Download and run the MSYS2 installer from:
https://www.msys2.org/
Follow the basic steps to get a default terminal for the UCRT64 environment.
Install dependencies:
where MINGW_PACKAGE_PREFIX should be mingw-w64-ucrt-x86_64. You can verify the environment variable using:
Clone the SDK repos using an adapted version of pico_setup.sh. Run the following from the user's home directory:
If for some reason the new environment variables are not picked up, source the startup script:
Checking with:
there should be four entries:
Now MSYS2 has a picotool binary:
https://packages.msys2.org/packages/min ... 4-picotool
but let's build from source. Clone the picotool repo and build it using the following script:
Build and install pioasm, using the following script:
Build the SDK samples:
Some picotool commands that worked. picotool may ask the user to install a driver via Zadig.
Tested on a Win 10 Pro (22H2) Intel PC.
I don't fully understand everything (especially stuff like build options) and I would want to test some more but it seems to be usable. MSYS2 cmake defaults to ninja. Built all pico-examples for pico/rp2040 successfully I think and blink_simple.uf2 ran fine on a Pico, uploaded using picotool. Since I won't be putting stuff on github, I am just dumping it here.![Very Happy :D]()
[1] Setup Raspberry PI Pico SDK in 5 minutes
https://gist.github.com/thewh1teagle/70 ... 4b0ae31f69
MSYS2 does have a picotool binary package, so some folks may be using the SDK on MSYS2 just fine. But I couldn't find any complete guides... anyway I got it done myself, the MSYS2 cmake reported some warnings but otherwise building stuff works almost like the Linux Mint setup that I was using. Also got picotool and pioasm built and installed.
Notes and shell scripts are in the attached archive. The notes are reproduced below for convenience, with some formatting adjustments.
Setup C/C++ SDK on MSYS2
========================
The following is based on the work of thewh1teagle at:
https://gist.github.com/thewh1teagle/70 ... 4b0ae31f69
Download and run the MSYS2 installer from:
https://www.msys2.org/
Follow the basic steps to get a default terminal for the UCRT64 environment.
Install dependencies:
Code:
pacman --needed -S $MINGW_PACKAGE_PREFIX-{toolchain,cmake,libusb,arm-none-eabi-toolchain,make} git make
Code:
set | grep MINGW
Code:
./pico_repo_setup_msys2.sh
Code:
source ~/.bashrc
Code:
set | grep PICO
Code:
PICO_EXAMPLES_PATH=/home/khman/pico/pico-examplesPICO_EXTRAS_PATH=/home/khman/pico/pico-extrasPICO_PLAYGROUND_PATH=/home/khman/pico/pico-playgroundPICO_SDK_PATH=/home/khman/pico/pico-sdk
https://packages.msys2.org/packages/min ... 4-picotool
but let's build from source. Clone the picotool repo and build it using the following script:
Code:
./picotool_setup_msys2.sh
Code:
./pioasm_setup_msys2.sh
Code:
cd ~/pico/pico-examplesmkdir build && cd buildcmake .. -DPICO_BOARD=pico -DPICO_PLATFORM=rp2040 -G "MSYS Makefiles"make
Code:
picotool infopicotool reboot -fpicotool load -x blink.uf2
I don't fully understand everything (especially stuff like build options) and I would want to test some more but it seems to be usable. MSYS2 cmake defaults to ninja. Built all pico-examples for pico/rp2040 successfully I think and blink_simple.uf2 ran fine on a Pico, uploaded using picotool. Since I won't be putting stuff on github, I am just dumping it here.

Statistics: Posted by katak255 — Tue Mar 04, 2025 8:27 pm — Replies 0 — Views 28