The ultimate way to build for Pico W on Windows...
-
Download
msys2
from msys2.org -
Open
MSYS2 UCRT64
terminal and execute setup script
git clone https://github.com/thewh1teagle/pico-setup
cd pico-setup
./setup
- Execute build script
./build
It will build and upload automatically.
That's it! 🎉
You ready to start your project...
picotool reboot -f -u
picotool load -x main.uf2
- Download zadig
- Select Option > List All Devices
- Select RP2040 (interface 1), may be different -> replace driver to libusb32
- Hit
win+r
- type devmgmt.msc and ENTER
- find the device and choose update device driver
- Choose "let me choose" and try to change it to something else
- copy the following in new file
ucrt.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\mingw64]
@="MinGW UCRT64 Here"
"Icon"="\"C:\\msys64\\ucrt64.ico\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\mingw64\command]
@="C:\\msys64\\msys2_shell.cmd -defterm -where \"%V/\" -ucrt64"
[HKEY_CLASSES_ROOT\Directory\shell\mingw64]
@="MinGW UCRT64 Here"
"Icon"="\"C:\\msys64\\ucrt64.ico\""
[HKEY_CLASSES_ROOT\Directory\shell\mingw64\command]
@="C:\\msys64\\msys2_shell.cmd -defterm -where \"%V/\" -ucrt64"
- open it and apply
![](https://private-user-images.githubusercontent.com/61390950/293948394-734eea80-fbb4-4011-89c1-84e2afb10b4c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxNTE1MDIsIm5iZiI6MTcyMjE1MTIwMiwicGF0aCI6Ii82MTM5MDk1MC8yOTM5NDgzOTQtNzM0ZWVhODAtZmJiNC00MDExLTg5YzEtODRlMmFmYjEwYjRjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI4VDA3MjAwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBmYWUyNGIxOThhNTRhZTE0ZDgwNmRjYmJiM2I5MDhiY2E3MjdjOWZiZTAwMGNjNThhNWJiNWRiMjZlNDY2NTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.XbXP0LMVvqckro1ZNDNpnOLMhThpu2TusReewh6k3HM)
- open windows terminal settings (top arrow ->
settings
) - open json settings (left dropdown ->
open JSON file
) - search for
profiles
and add to profiles list the following
{
"guid": "{17da3cac-b318-431e-8a3e-7fcdefe6d114}",
"name": "UCRT64 / MSYS2",
"commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -ucrt64",
"startingDirectory": "C:/msys64/home/%USERNAME%",
"icon": "C:/msys64/ucrt64.ico",
"font":
{
"face": "Lucida Console",
"size": 9
}
}
Play with pico-examples
git clone https://github.com/raspberrypi/pico-examples --depth 1
cd pico-examples
cmake -B build .
cmake --build build blink -- -j16
picotool load -x build/blink/blink/uf2
The ultimate way to build for Pico W on macOS...
- Install toolchain
brew install gcc-arm-embedded
brew install picotool
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/thewh1teagle/serust/releases/download/v0.0.3/serust-installer.sh | sh
- Install Pico SDK
sudo mkdir -p /usr/local/share/pico-sdk
sudo chown $(whoami) /usr/local/share/pico-sdk
cd /usr/local/share/pico-sdk
git clone --recursive --depth 1 https://github.com/raspberrypi/pico-sdk.git .
export PICO_SDK_PATH=/usr/local/share/pico-sdk
echo 'export PICO_SDK_PATH=/usr/local/share/pico-sdk' >> ~/.zshrc
source ~/.zshrc
- Build time
cmake -B build -DPICO_BOARD=pico_w -DPICO_PLATFORM=rp2040
cmake --build build -- -j16
- Upload
picotool load build/app.elf
- Monitor
serust --pid 000a