EasyManua.ls Logo

Raspberry Pi RP2040 User Manual

Raspberry Pi RP2040
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 #43 background imageLoading...
Page #43 background image
C:\Users\pico\Downloads> git clone -b master https://github.com/raspberrypi/pico-sdk.git
C:\Users\pico\Downloads> cd pico-sdk
C:\Users\pico\Downloads\pico-sdk> git submodule update --init
C:\Users\pico\Downloads\pico-sdk> cd ..
C:\Users\pico\Downloads> git clone -b master https://github.com/raspberrypi/pico-examples.git
9.2.3. Building "Hello World" from the Command Line
Go ahead and open a Developer Command Prompt Window from the Windows Menu, by selecting
Windows > Visual
Studio 2019 > Developer Command Prompt
from the menu.
Then set the path to the SDK as follows,
C:\Users\pico\Downloads> setx PICO_SDK_PATH "..\..\pico-sdk"
You now need close your current Command Prompt Window and open a second Command Prompt Window where this
environment variable will now be set correctly before proceeding.
Navigate into the pico-examples folder, and build the 'Hello World' example as follows,
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.
Getting started with Raspberry Pi Pico
9.2. Building on MS Windows 42

Table of Contents

Question and Answer IconNeed help?

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

Raspberry Pi RP2040 Specifications

General IconGeneral
ProcessorDual-core Arm Cortex-M0+
Clock Speed133 MHz
SRAM264 KB
GPIO30
USBUSB 1.1 Host/Device
PWM16 channels
UART2
SPI2
I2C2
Temperature Range-20°C to +85°C
Operating Voltage1.8V to 3.3V
FlashExternal QSPI flash
I/O InterfacesSPI, I2C, UART, PWM
ADC4 × 12-bit ADC channels

Summary

Chapter 1. Quick Pico Setup

Quick Pico Setup

Steps to quickly set up your development environment for Raspberry Pi Pico, including script execution.

Chapter 2. The SDK

Get the SDK and examples

Instructions for downloading and cloning the Raspberry Pi Pico SDK and example repositories.

Install the Toolchain

Steps to install necessary tools like CMake and the GNU Embedded Toolchain for Arm.

Chapter 3. Blinking an LED in C

Build, Load, and Run 'Blink'

Steps to build, load, and run the 'Blink' example program on the Raspberry Pi Pico.

Chapter 4. Saying 'Hello World' in C

Serial Input and Output

Explains how serial input/output works on the Pico via UART or USB CDC.

Build and Run 'Hello World'

Steps to build, flash, and run the 'Hello World' example.

Chapter 5. Flash Programming with SWD

Install OpenOCD

Instructions for installing OpenOCD, a debug translator for SWD.

SWD Port Wiring and Loading

Details on wiring the SWD port and loading programs via OpenOCD.

Chapter 6. Debugging with SWD

Debug Build and GDB Installation

Creating a debug build and installing GNU Debugger (GDB) for interactive debugging.

Chapter 7. Using Visual Studio Code

Chapter 8. Creating Your Own Project

Appendix A: Using Picoprobe

Related product manuals