Skip to content

Harden USB commands and calibration refresh#44

Merged
tadelv merged 2 commits into
decentespresso:developfrom
skialpine:codex/usb-calibration-hardening
May 4, 2026
Merged

Harden USB commands and calibration refresh#44
tadelv merged 2 commits into
decentespresso:developfrom
skialpine:codex/usb-calibration-hardening

Conversation

@skialpine
Copy link
Copy Markdown
Contributor

Summary

  • Validate USB packet lengths before reading indexed bytes
  • Build text commands from the received length instead of assuming a null-terminated buffer
  • Reject invalid tare checksums before changing tare state
  • Report ADS reset refresh failures and abort calibration when dataset refresh fails

Context

This hardens command parsing against short USB frames and makes calibration/reset paths compatible with ADC refresh timeouts, so stale samples are not used after a failed refresh.

Validation

  • platformio run
  • Also tested the combined local firmware on an attached ESP32-S3 with platformio run -t upload --upload-port /dev/cu.wchusbserial110; flash verification completed successfully.

@skialpine skialpine changed the base branch from main to develop May 4, 2026 14:03
@skialpine skialpine marked this pull request as ready for review May 4, 2026 14:04
@skialpine skialpine force-pushed the codex/usb-calibration-hardening branch from d9f080b to e315907 Compare May 4, 2026 14:08
@tadelv tadelv merged commit 1518467 into decentespresso:develop May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants