スキル一覧に戻る
njfdev

pico-logger

by njfdev

The code for the entire payload system onboard the 2025 NCSSM HPR rocket named C.A.V.E.R.N.

1🍴 0📅 2026年1月18日
GitHubで見るManusで実行

SKILL.md


name: pico-logger description: Pico Logger subproject context. Use when working in the pico_logger package, RP2040 firmware, sensor data collection, SD card logging, or embedded telemetry. keywords: [pico logger, pico_logger, data logger, sensor, adalogger, feather, rp2040, firmware, telemetry, sd card, csv, usb cdc, serial]

Pico Logger Subproject

Hardware

Board: Adafruit Feather RP2040 Chip: RP2040 (Cortex-M0+, ARMv6-M) Target: thumbv6m-none-eabi

CRITICAL: This is an RP2040, NOT RP2350. Use rp2040 feature in embassy-rp.

Role in System

The Pico Logger is the low-level data acquisition unit of the payload system, running bare-metal on an Adafruit Feather RP2040.

Responsibilities

  • Collect data from multiple sensors at high rates
  • Log all sensor data to SD card
  • Send telemetry to flight computer via USB serial
  • Operate reliably during high-G flight conditions

Sensors

SensorTypeInterface
BMP390Barometer/AltitudeI2C
ENS160Air Quality/GasI2C
LSM6DSOX6-axis IMUI2C
LIS3MDLMagnetometerI2C
HGLRC Mini M100GPSUART

Storage

  • SPI SD card for flight data logging

Build & Flash

cd pico_logger

# Build
cargo build --release

# Flash (device must be in BOOTSEL mode)
cargo run --release

# Or use the helper script
.claude/skills/pico-tooling/scripts/wait_bootsel.sh && cargo run --release

Entering BOOTSEL Mode

  1. Hold BOOTSEL button on the Feather
  2. Press reset button (or replug USB while holding BOOTSEL)
  3. Release BOOTSEL
  4. Device appears as USB mass storage "RPI-RP2"

Memory Layout (RP2040)

BOOT2: 256B  @ 0x10000000 (second-stage bootloader)
FLASH: 2048K @ 0x10000100
RAM:   256K  @ 0x20000000

The RP2040 has 264KB SRAM total (6 banks), but 256K is the usable contiguous region.

Configuration Files

.cargo/config.toml

[target.'cfg(all(target_arch = "arm", target_os = "none"))']
runner = "picotool load -u -v -x -t elf"

[build]
target = "thumbv6m-none-eabi"

Cargo.toml Dependencies

embassy-rp = { version = "0.9.0", features = ["rp2040", "binary-info", "critical-section-impl", "time-driver", "unstable-pac"] }
portable-atomic = { version = "1", features = ["critical-section"] }  # Required for RP2040 atomics

memory.x (RP2040)

MEMORY {
    BOOT2 : ORIGIN = 0x10000000, LENGTH = 0x100
    FLASH : ORIGIN = 0x10000100, LENGTH = 2048K - 0x100
    RAM   : ORIGIN = 0x20000000, LENGTH = 256K
}

EXTERN(BOOT2_FIRMWARE)

SECTIONS {
    .boot2 ORIGIN(BOOT2) :
    {
        KEEP(*(.boot2));
    } > BOOT2
} INSERT BEFORE .text;

SECTIONS {
    .bi_entries : ALIGN(4)
    {
        __bi_entries_start = .;
        KEEP(*(.bi_entries));
        . = ALIGN(4);
        __bi_entries_end = .;
    } > FLASH
} INSERT AFTER .text;

USB Serial Communication

The firmware uses USB CDC ACM for serial communication:

  • Device appears as /dev/cu.usbmodem* on macOS
  • Baud rate doesn't matter (USB CDC)
  • Use serial_monitor.py from pico-tooling scripts

Key Dependencies

CrateVersionPurpose
embassy-executor0.9.1Async task runtime
embassy-rp0.9.0RP2040 HAL (use rp2040 feature)
embassy-usb0.5USB device stack
embassy-sync0.7.2Channels, mutexes
embassy-time0.4Async timers
static_cell2.1Static buffer allocation
portable-atomic1Atomics for Cortex-M0+
heapless0.8Stack-allocated collections

TODO / Planned Features

  • Log data to SPI SD card
  • Log data from BMP390 (Barometer)
  • Log data from ENS160 (Gas)
  • Log data from LSM6DSOX + LIS3MDL (IMU)
  • Log data from HGLRC Mini M100 (GPS)
  • Send sensor data to flight_computer board
  • Add reset-to-bootsel command over USB
  • embassy-rp: HAL and peripheral usage
  • embassy: Async framework patterns
  • sensor-drivers: Individual sensor details
  • sd-card-logging: Data storage patterns
  • pico-tooling: Flashing, serial, and debug tools
  • flight-computer: Telemetry destination

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です