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 #7 background imageLoading...
Page #7 background image
Chapter 2. The SDK
IMPORTANT
The following instructions assume that you are using a Raspberry Pi Pico and some details may differ if you are
using a different RP2040-based board. They also assume you are using Raspberry Pi OS running on a Raspberry Pi 4,
or an equivalent Debian-based Linux distribution running on another platform. Alternative instructions for those
using Microsoft Windows (see Section 9.2) or Apple macOS (see Section 9.1) are also provided.
The Raspberry Pi Pico is built around the RP2040 microcontroller designed by Raspberry Pi. Development on the board
is fully supported with both a C/C++ SDK, and an official MicroPython port. This book talks about how to get started
with the SDK, and walks you through how to build, install, and work with the SDK toolchain.
TIP
For more information on the official MicroPython port see the Raspberry Pi Pico Python SDK book which documents
the port, and Get started with MicroPython on Raspberry Pi Pico by Gareth Halfacree and Ben Everard, published by
Raspberry Pi Press.
TIP
For more information on the C/C++ SDK, along with API-level documentation, see the Raspberry Pi Pico C/C++ SDK
book.
2.1. Get the SDK and examples
The pico-examples repository (https://github.com/raspberrypi/pico-examples) provides a set of example applications
that are written using the pico-sdk (https://github.com/raspberrypi/pico-sdk). To clone these repositories start by
creating a pico directory to keep all pico related checkouts in. These instructions create a pico directory at /home/pi/pico.
$ cd ~/
$ mkdir pico
$ cd pico
Then clone the pico-sdk and pico-examples git repositories.
$ git clone -b master https://github.com/raspberrypi/pico-sdk.git
$ cd pico-sdk
$ git submodule update --init
$ cd ..
$ git clone -b master https://github.com/raspberrypi/pico-examples.git
Getting started with Raspberry Pi Pico
2.1. Get the SDK and examples 6

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