No description
  • CMake 51.5%
  • C 38.5%
  • Python 10%
Find a file
eggcitedraccoon 7dc38a4f99
All checks were successful
Test CI Pipeline / test (push) Successful in 13s
Build and Deploy Documentation / deploy-docs (push) Successful in 2m48s
Use raw binary data upload for Forge-Pages deploy endpoint
Co-authored-by: Junie <junie@jetbrains.com>
2026-09-25 15:18:09 +02:00
.forgejo/workflows Use raw binary data upload for Forge-Pages deploy endpoint 2026-09-25 15:18:09 +02:00
docs Add MkDocs documentation and Forge-Pages CI deployment workflow 2026-09-25 15:14:50 +02:00
.gitignore Add MkDocs documentation and Forge-Pages CI deployment workflow 2026-09-25 15:14:50 +02:00
CMakeLists.txt Initial commit: Raspberry Pi Pico test project 2026-09-25 12:26:12 +02:00
main.c Initial commit: Raspberry Pi Pico test project 2026-09-25 12:26:12 +02:00
main.py Initial commit: Raspberry Pi Pico test project 2026-09-25 12:26:12 +02:00
mkdocs.yml Add MkDocs documentation and Forge-Pages CI deployment workflow 2026-09-25 15:14:50 +02:00
pico_sdk_import.cmake Initial commit: Raspberry Pi Pico test project 2026-09-25 12:26:12 +02:00
README.md Trigger CI run 2 2026-09-25 13:55:04 +02:00

Raspberry Pi Pico Hardware Test Project

This project provides a complete test suite and setup guide for the Raspberry Pi Pico, Pico W, and Pico 2 (RP2350).


🎯 What This Test Verifies

  1. Microcontroller Core & System Clocks: Verifies the processor starts properly and runs at standard clock frequencies (125 MHz sys clock).
  2. Onboard LED Blink: Hardware GPIO control and timing checks.
  3. Internal Temperature Sensor: Reads analog voltage from ADC channel 4 and computes temperature in °C and °F.
  4. USB CDC Serial Communication: Transmits real-time heartbeat logs and receives interactive terminal commands over standard USB cable.
  5. Software BOOTSEL Reset: Allows software reboot into flasher mode without physically unplugging the cable.

📁 Project Structure

test-rpi-pico/
├── CMakeLists.txt           # CMake build configuration for C/C++ SDK
├── pico_sdk_import.cmake    # Raspberry Pi Pico SDK importer
├── main.c                   # C firmware (Blink, ADC Temp, USB Serial CLI)
├── main.py                  # MicroPython alternative script
├── .gitignore
└── README.md                # Complete setup and walkthrough documentation

🚀 Walkthrough: Method 1 (C/C++ Pico SDK)

1. Build the Firmware

Open a terminal in the project directory:

mkdir -p build
cd build
cmake ..
make -j$(nproc)

This compiles the firmware and produces:

  • build/test_rpi_pico.uf2 (Ready for drag-and-drop flashing)
  • build/test_rpi_pico.elf (For debugging via SWD / GDB)
  • build/test_rpi_pico.hex / build/test_rpi_pico.bin

2. Flash to Raspberry Pi Pico

Drag-and-Drop Method (No extra tools required):

  1. Unplug your Pico from your computer.
  2. Press and hold the white BOOTSEL button on the Pico board.
  3. While holding the button, plug the Pico into your computer via USB.
  4. Release the BOOTSEL button. The Pico will mount as a USB storage drive named RPI-RP2 (or RP2350 on Pico 2).
  5. Copy the .uf2 file to the drive:
    cp build/test_rpi_pico.uf2 /media/$USER/RPI-RP2/
    
    (Or drag and drop test_rpi_pico.uf2 in your file manager).
  6. The drive will automatically disconnect and the Pico will reboot running the new firmware.

Command-Line Method using picotool:

With the Pico in BOOTSEL mode:

picotool load -x build/test_rpi_pico.uf2

3. Open Serial Terminal to Monitor & Test

Once flashed, the onboard LED will start blinking, and the Pico will expose a USB Serial port (typically /dev/ttyACM0 on Linux, COMx on Windows, /dev/cu.usbmodem* on macOS).

Connect to the serial monitor:

# Using minicom:
minicom -b 115200 -o -D /dev/ttyACM0

# Or using picocom:
picocom -b 115200 /dev/ttyACM0

# Or using screen:
screen /dev/ttyACM0 115200

Interactive Commands:

Type any of these keys into the serial terminal:

  • h or ?: Display the help menu
  • t: Read immediate temperature sensor value
  • l: Toggle LED blinking on/off
  • i: Display system clocks & uptime information
  • b: Reboot Pico directly back into BOOTSEL mode for rapid re-flashing

🐍 Walkthrough: Method 2 (MicroPython)

If you prefer testing with Python:

  1. Install MicroPython Firmware:
  2. Run the Test Script:
    • Open Thonny IDE (or your favorite IDE) and select MicroPython (Raspberry Pi Pico) interpreter at the bottom right.
    • Open main.py and click Run.
    • Or run from command line using mpremote:
      pip install mpremote
      mpremote run main.py
      

🔧 Troubleshooting & Tips

  • Permission Denied on /dev/ttyACM0 (Linux): Add your user to the dialout group to access serial devices without sudo:

    sudo usermod -a -G dialout $USER
    

    (Log out and log back in for changes to take effect).

  • Pico Doesn't Appear as RPI-RP2 Drive:

    • Verify your USB cable supports data transfer (some cheap cables are charge-only).
    • Ensure you are holding BOOTSEL firmly before inserting the USB cable and releasing it after it is plugged in.

trigger 2