-
Clone the repository and navigate to the Example project:
cd Example/ -
Install swiftly and other dependencies if using linux: Linux: First, install required system dependencies:
sudo apt install build-essential libhidapi-hidraw0 libhidapi-libusb0
Linux and macOS: Install Swiftly from swift.org and ensure all dependencies mentioned at the end of the build script are installed.
-
Run the build script for the first time:
bash build.sh
⏱️ Note: The first run will take a couple of minutes as it downloads all dependencies (Pico SDK, toolchains, and Swift packages).
-
Open in VSCode (optional but recommended): Install the recommended extensions when prompted. This enables full IDE integration with debugging and flashing capabilities.
Once your project is built, you have two options for programming your RP2xxx device:
-
Using cortex-debug (with debug probe): Connect an SWD debug probe (like a Raspberry Pi Debug Probe or Picoprobe) to your device. This enables full debugging with breakpoints, variable inspection, and step-through execution.
-
Using picotool (USB flashing): Hold down the BOOTSEL button while connecting your device via USB (or press it while pressing the reset button). The device will appear as a USB mass storage device, and picotool can directly write the firmware without needing a debug probe.