diff --git a/website/content/docs/getting-started.smd b/website/content/docs/getting-started.smd index 044ca40e8..2e1cd454e 100644 --- a/website/content/docs/getting-started.smd +++ b/website/content/docs/getting-started.smd @@ -10,7 +10,7 @@ # Getting Started -## Blinky on the Raspberry Pi Pico +## Blinky on the Raspberry Pi Pico and Pico 2 This tutorial assumes that you're programming a [Raspberry Pi Pico](https://www.raspberrypi.com/products/raspberry-pi-pico/). This hardware @@ -20,6 +20,11 @@ it does support other hardware, such as Microchip's `ATSAMD51J19` which was used for the [2024 SYCL](https://sycl.it) [Badge](https://github.com/ZigEmbeddedGroup/sycl-badge/blob/main/docs/introduction/). +If you're using a Raspberry Pi Pico 2 instead, you can follow the same tutorial. +The main change is in your `build.zig`, where the board target should be +`mb.ports.rp2xxx.boards.raspberrypi.pico2_arm` instead of +`mb.ports.rp2xxx.boards.raspberrypi.pico`. + ## Let's Begin Quickly check that you have Zig `0.15.1` installed by running `zig version`. @@ -59,6 +64,12 @@ pub fn build(b: *std.Build) void { } ``` +If you're building for a Pico 2, change the target line to: + +```zig +.target = mb.ports.rp2xxx.boards.raspberrypi.pico2_arm, +``` + and for your `src/main.zig`, let's start with a classic blinky program. Yes, most of the main stdlib is available for use on an MCU with Zig: @@ -104,11 +115,11 @@ zig-out/firmware/blinky.elf: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SY ## Programming the MCU -To activate the UF2 bootloader, power must be applied to the pico while the -`BOOTSEL` button is held. This is best done by connecting a button from `RUN` -to ground, pressing both buttons, and releasing the `RUN` button first, then -`BOOTSEL`. The other option is to plug/unplug the USB cable which is awkward -and gets tiresome. +To activate the UF2 bootloader, power must be applied to the Pico or Pico 2 +while the `BOOTSEL` button is held. This is best done by connecting a button +from `RUN` to ground, pressing both buttons, and releasing the `RUN` button +first, then `BOOTSEL`. The other option is to plug/unplug the USB cable which +is awkward and gets tiresome. Copy the uf2 file into the mounted drive. Execution should take place immediately.