Datasheet
Table Of Contents
- Getting started with Raspberry Pi Pico
- Colophon
- Chapter 1. Quick Pico Setup
- Chapter 2. The SDK
- Chapter 3. Blinking an LED in C
- Chapter 4. Saying "Hello World" in C
- Chapter 5. Flash Programming with SWD
- Chapter 6. Debugging with SWD
- Chapter 7. Using Visual Studio Code
- Chapter 8. Creating your own Project
- Chapter 9. Building on other platforms
- Chapter 10. Using other Integrated Development Environments
- Appendix A: Using Picoprobe
- Appendix B: Using Picotool
- Appendix C: Documentation Release History
C:\Users\pico\Downloads> cd pico-examples
C:\Users\pico\Downloads\pico-examples> mkdir build
C:\Users\pico\Downloads\pico-examples> cd build
C:\Users\pico\Downloads\pico-examples\build> cmake -G "NMake Makefiles" ..
C:\Users\pico\Downloads\pico-examples\build> nmake
to build the target. This will produce ELF, bin, and uf2 targets, you can find these in the hello_world/serial and
hello_world/usb directories inside your build directory. The UF2 binaries can be dragged-and-dropped directly onto a
RP2040 board attached to your computer using USB.
9.2.4. Building "Hello World" from Visual Studio Code
Now you’ve installed the toolchain you can install Visual Studio Code and build your projects inside the that environment
rather than from the command line.
Go ahead and download and install Visual Studio Code for Windows. After installation open a Developer Command
Prompt Window from the Windows Menu, by selecting Windows > Visual Studio 2019 > Developer Command Prompt from the
menu. Then type,
C:> code
at the prompt. This will open Visual Studio Code with all the correct environment variables set so that the toolchain is
correctly configured.
WARNING
If you start Visual Studio code by clicking on its desktop icon, or directly from the Start Menu then the build
environment will not be correctly configured. Although this can be done manually later in the CMake Tools Settings,
the easiest way to configure the Visual Studio Code environment is just to open it from a Developer Command
Prompt Window where these environmental variables are already set.
We’ll now need to install the CMake Tools extension. Click on the Extensions icon in the left-hand toolbar (or type Ctrl +
Shift + X), and search for "CMake Tools" and click on the entry in the list, and then click on the install button.
Then click on the Cog Wheel at the bottom of the navigation bar on the left-hand side of the interface and select
"Settings". Then in the Settings pane click on "Extensions" and the "CMake Tools configuration". Then scroll down to
"Cmake: Configure Environment". Click on "Add Item" and add set the PICO_SDK_PATH to be ..\..\pico-sdk as in Figure 19.
Getting started with Raspberry Pi Pico
9.2. Building on MS Windows 42