Adolfo Reyna bc8ae91eba single repo
2026-01-01 13:33:51 -05:00
2025-11-17 23:34:35 -05:00
2025-11-26 12:29:21 -05:00
2026-01-01 13:33:51 -05:00
2026-01-01 13:33:51 -05:00
2025-11-17 23:34:35 -05:00
2025-12-09 11:18:44 -05:00
2025-11-19 22:26:52 -05:00
2025-11-19 22:26:52 -05:00
2025-12-10 08:09:38 -05:00
2025-11-17 23:34:35 -05:00
2025-12-28 22:11:33 -05:00
2025-12-09 18:30:42 -05:00
2025-11-29 22:55:07 -05:00

hello_usb (Pico) — Build & Flash

Quick instructions to compile and flash the hello_usb project for Raspberry Pi Pico / RP2-based boards.

Prerequisites

  • GNU Arm Embedded Toolchain (arm-none-eabi)
  • CMake (>= 3.13) and Ninja
  • Pico SDK (included in this repo as pico-sdk/) or installed separately
  • picotool (optional, for USB flashing) or OpenOCD + SWD adapter (for debugging/flashing)
  • On macOS: install tools via Homebrew where available (e.g. cmake, ninja, open-ocd)

Ensure arm-none-eabi-gcc, cmake, and ninja are available in PATH:

which arm-none-eabi-gcc cmake ninja

Build

From the project root (where CMakeLists.txt lives):

# set PICO_SDK_PATH to the bundled SDK in this repo (adjust if using system SDK)
export PICO_SDK_PATH=$(pwd)/pico-sdk

mkdir -p build
cd build
# configure & generate (Ninja)
cmake .. -G Ninja
# build
ninja

After a successful build you should find artifacts under build/ such as hello_usb.uf2 and hello_usb.elf.

Flashing

Choose one of the methods below.

  • UF2 (mass-storage) — easiest for Pico in BOOTSEL mode:

    1. Hold BOOTSEL on the Pico and connect it via USB.
    2. Copy build/hello_usb.uf2 onto the mounted RPI-RP2 mass storage device.
  • picotool (USB) — if picotool is installed:

# Example (adjust path if needed):
picotool load build/hello_usb.uf2 -f -x
  • OpenOCD + SWD (CMSIS-DAP) — for programmers/debugging:
# Example template (adjust openocd script paths and target cfg for your board):
openocd -s /path/to/openocd/scripts \
  -f interface/cmsis-dap.cfg \
  -f target/rp2040.cfg \
  -c "adapter speed 5000; program \"$(pwd)/build/hello_usb.elf\" verify reset exit"

The VSCode workspace already includes tasks for building and flashing:

  • Compile Project — runs ninja -C build
  • Run Project — uses picotool to load the target (see .vscode/tasks / your task runner)

Troubleshooting

  • If CMake cannot find the SDK, ensure PICO_SDK_PATH points to the pico-sdk/ folder.
  • Verify the toolchain: arm-none-eabi-gcc --version.
  • If UF2 flashing doesn't work, try picotool or an SWD programmer (OpenOCD + CMSIS-DAP).
  • For OpenOCD errors, ensure correct interface/target .cfg files and that the adapter is connected.

Notes

  • Modify the cmake configuration or CMakeLists.txt if you need custom board or build options.
  • If using a centralized Pico SDK installation, set PICO_SDK_PATH to that location instead of the bundled pico-sdk/.

If you want, I can run the build here or add a short Makefile or CI job to automate builds.

Description
No description provided
Readme 13 MiB
Languages
C 87.6%
Python 10.8%
C++ 1.3%
CMake 0.3%