Skip to content

feat: Add hardware-in-the-loop firmware update validation script #8

@tylerkron

Description

@tylerkron

Context

Once the firmware CLI commands are available (see #7), we need a validation workflow that can be run against real hardware to verify the core firmware update implementation works end-to-end. This is the "AI feedback loop" use case — a coding agent can run this script after making changes to verify nothing is broken.

Scope

Validation Script

  • Create scripts/validate-firmware-update.sh (or PowerShell equivalent)
  • Automated test sequence:
    1. Discover device on USB/serial
    2. Read current firmware version
    3. Check for available update
    4. Flash firmware (latest or specified hex file)
    5. Verify device reboots and is discoverable again
    6. Read firmware version and confirm it changed (or matches expected)
    7. Optionally run a short data streaming test to verify device works post-update
  • Exit code 0 = all checks pass, non-zero = failure with diagnostic output
  • --skip-flash mode to test everything except the actual flash (for CI without dedicated hardware)

Validation Criteria

  • Device is discoverable before update
  • Firmware update completes without timeout
  • Device is discoverable after update
  • Firmware version matches expected version post-update
  • Device can stream data after update (basic smoke test)
  • Total update time is within expected bounds (flag if abnormally slow)

CI Integration Notes

  • Document required environment: USB-connected DAQiFi device, COM port
  • Document how to run manually during development
  • JSON output from CLI commands enables programmatic validation
  • Consider GitHub Actions self-hosted runner with hardware attached (future)

Example Usage

# Full validation with auto-detected device
./scripts/validate-firmware-update.sh

# Validation with specific port and hex file
./scripts/validate-firmware-update.sh --port COM3 --hex-file ./firmware-v1.2.0.hex

# Skip actual flash (dry-run validation)
./scripts/validate-firmware-update.sh --skip-flash --port COM3

# AI agent usage pattern
dotnet run -- --firmware-flash --latest --port COM3 --json && \
dotnet run -- --discover --json | jq '.devices[0].firmware_version'

Acceptance Criteria

  • Script can validate full firmware update cycle against real hardware
  • Clear pass/fail output with diagnostic information on failure
  • A coding agent can run this script to verify firmware update changes work
  • Documented in README with prerequisites and usage

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions