EasyManua.ls Logo

Raspberry Pi Pico User Manual

Raspberry Pi Pico
77 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #38 background imageLoading...
Page #38 background image
Ê "PICO_SDK_PATH":"../../pico-sdk"
Ê },
}
Now 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: Generator" and enter "Unix Makefiles" into the box.
NOTE
Depending on your local setup you may not need to set the CMake generator manually to "Unix Makefiles". However
if you do not do so in some cases Visual Studio will default to ninja rather than make and the build might fail as GCC
outputs dependency-information in a slightly-incorrect format that ninja can’t understand.
If you do find yourself having to configure this variable manually it is also possible that you may need to point Visual
Studio at the CMake Tools extension explicitly by adding the an additional line to your settings.json file,
{
Ê "cmake.environment": {
Ê "PICO_SDK_PATH": "../../pico-sdk"
Ê },
Ê "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
}
Then go to the File menu and click on "Add Folder to Workspace…" and navigate to pico-examples repo and hit "Okay".
The project will load and you’ll (probably) be prompted to choose a compiler, see Figure 13. Select "GCC for arm-none-
eabi" for your compiler.
Figure 13. Prompt to
choose the correct
compiler for the
project.
Finally go ahead and click on the "Build" button (with a cog wheel) in the blue bottom bar of the window. This will create
the build directory and run CMake as we did by hand in Section 3.1, before starting the build itself, see Figure 9.
This will produce ELF, bin, and uf2 targets, you can find these in the hello_world/serial and hello_world/usb directories
inside the newly created build directory. The UF2 binaries can be dragged-and-dropped directly onto a RP2040 board
attached to your computer using USB.
Getting started with Raspberry Pi Pico
9.1. Building on Apple macOS 37

Table of Contents

Question and Answer IconNeed help?

Do you have a question about the Raspberry Pi Pico and is the answer not in the manual?

Raspberry Pi Pico Specifications

General IconGeneral
MicrocontrollerRP2040
Clock Speed133 MHz
SRAM264 KB
Flash Memory2 MB
GPIO Pins26
Operating Temperature-20°C to +85°C
ArchitectureARM Cortex-M0+ (dual-core)
InterfacesI2C, SPI, UART, PWM
Operating Voltage1.8–5.5 V
Dimensions51 mm × 21 mm

Summary

1. Quick Pico Setup

2. The SDK

2.1. Get the SDK and Examples

Download and clone the SDK and example repositories for development.

2.2. Install the Toolchain

Install necessary tools like CMake and the ARM embedded toolchain.

3. Blinking an LED in C

3.1. Building 'Blink'

Compile the 'Blink' C example program for the Raspberry Pi Pico.

3.2. Load and Run 'Blink'

Load and execute the compiled 'Blink' program onto the Raspberry Pi Pico.

4. Saying "Hello World" in C

4.3. Flash and Run 'Hello World'

Load and execute the compiled 'Hello World' program onto the Raspberry Pi Pico.

5. Flash Programming with SWD

5.3. Loading a Program

Use OpenOCD to load .elf program binaries into flash memory.

6. Debugging with SWD

6.3. Use GDB and OpenOCD for Debugging

Combine GDB and OpenOCD to interactively debug the 'Hello World' example.

7. Using Visual Studio Code

7.3. Debugging a Project

Set up and perform debugging for a project using VS Code and OpenOCD.

8. Creating Your Own Project

8.1. Debugging Your Project

Debug a custom project using command line tools and OpenOCD.

Appendix A: Using Picoprobe

Related product manuals