Pico_sdk_on_windows_guide
Pico_sdk_on_windows_guide
(using the C/C++ SDK) with Raspberry Pi Pico and other RP2040-based
boards. It is inspired by, and is roughly equivalent to, the pico-setup project
Once you have finished configuring the PICO SDK, you can recursively clone
our product Repo to get an almost complete experience, but since some of
the code doesn't compile properly on Windows, there are still features that
Foundation.
The rest of this README document is about developing the installer itself. If
you just want to install and use the compilers and toolchain, download the
Included software
• CMake
• Ninja
• Python 3.9
• OpenOCD
Building
You will need PowerShell 7.2 or newer in order to run the build script.
See Installing PowerShell on Windows for download links and instructions. Note
that this is needed only for building the installer itself, and not for end-user
The installers are built with NSIS 3. The NSIS script is generated
by build.ps1 when provided with a JSON configuration file. The build script
local copy of MSYS2. You can specify a path to an existing copy of MSYS2
using the -MSYS2Path option. The build script will install a copy of MSYS2 at
Tests
There are tests for some parts of the build scripts. You can run them like this:
In your Start Menu, look for the Pico - Visual Studio Code shortcut, in
the Raspberry Pi Pico SDK <version> folder. The shortcut sets up the needed
The first time you launch Visual Studio Code using the Start Menu shortcut, it
at C:\Users\<user>\Documents\Pico-<version>\pico-examples.
Building an example
Visual Studio Code will ask if you want to configure the pico-examples project
when it is first opened; click Yes on that prompt to proceed. (If you miss the
prompt look for the 'bell' icon in the bottom right.) You will then be prompted
to select a kit -- select the Pico ARM GCC - Pico SDK Toolchain with GCC arm-
none-eabi entry. If the Pico ARM GCC entry is not present, select Unspecified to
To build one of the examples, click the CMake button on the sidebar. You
should be presented with a tree view of the example projects; expand the
project you'd like to build, and click the small build icon to the right of the
To build everything instead, click the Build All Projects button at the top of the
Debugging an example
debugging with Visual Studio Code. You can copy these files into your own
projects as well.
To start debugging an example, click the Run and Debug button on the
start debugging, click the small 'play' icon at the top of the debug window, or
press F5.
The first time you start debugging, you will be prompted to select a target. If
you wish to later change the launch target, you can do so using the status bar
Assuming that you have a Picoprobe configured and connected to your target
device, your selected target should now be built, uploaded, and started. The
debugger interface will load, and will pause the execution of the code at
At this point, you can use the usual debugging tools to step, set breakpoints,
The Raspberry Pi Pico board used as Picoprobe should be flashed with the
included with the SDK installer only supports the CMSIS-DAP version of
Picoprobe.
Open serial monitor in VSCode
The SDK installer adds the Serial Monitor extension to Visual Studio Code.
Picoprobe includes a USB-serial bridge as well; assuming that you have wired
should have an option to select COMn - USB Serial Device (COMn) in the Serial
The baud rate should be set to the default of 115200 in most cases. Click Start
Command-line usage
To build and debug projects using command-line tools, you can open a
If you wish to run gdb from the command line, you can invoke it like this:
arm-none-eabi-gdb
For example, to load and debug the hello_serial example, you might do:
The commands below are for PowerShell, and will need to be adjusted slightly
copy ${env:PICO_SDK_PATH}\external\pico_sdk_import.cmake .
2. Copy VS Code configuration from the SDK examples into your project
directory:
16. Write your code (see pico-examples or the Raspberry Pi Pico C/C++
#include <stdio.h>
#include "pico/stdlib.h"
int main() {
setup_default_uart();
printf("Hello, world!\n");
return 0;
}
Note this example uses the default UART for stdout; if you want to use
17. Launch VS Code from the Pico - Visual Studio Code shortcut in the Start
18. Configure the project by running the CMake: Configure command from
Uninstalling
Open the Apps and Features section in Windows Settings, then
select Raspberry Pi Pico SDK <version>. Click the Uninstall button and follow
the prompts.