Skip to content

Add portable flight-computer self-test and datasheet-backed checks - #138

Merged
inez9 merged 2 commits into
inez/flight_computerfrom
pranay/self-test-driver-seam
Oct 26, 2026
Merged

inez9 merged 2 commits into
inez/flight_computerfrom
pranay/self-test-driver-seam

Conversation

@pranayD21

@pranayD21 pranayD21 commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

The flight-computer branch initializes peripherals but has no self-test coordinator or device-level health checks. This adds portable C self-test logic and five datasheet-backed SPI checks, with explicit unsupported/unconfigured results for missing integrations.

Changes

  • Resolve the existing load-cell PlatformIO configuration conflict that blocked firmware CI.

  • Coordinate bounded attempts, round-robin probes, required/optional results, raw battery sample validity and periodic heartbeat callbacks. Reset starts a fresh test session.

  • Check ISM330DHCX and H3LIS100DL identity registers, MS5611 calibration PROM CRC, W5500 chip version, and SX1262 status/errors through an injected, bounded SPI transport.

  • Add host tests and a separate sanitizer CI job. Tests cover exact wire messages, manufacturer CRC vectors, corrupt replies, timeout/error handling, reset and scheduling behavior.

  • Document component-to-pin mappings, datasheet references, adapter requirements and unresolved hardware questions in firmware/Core/DEVICE_CHECKS.md and firmware/Core/README.md.

Validation

  • Both CTest suites pass with AddressSanitizer and UndefinedBehaviorSanitizer.
  • Both suites pass in Release configuration with warnings treated as errors.
  • Formatting and git diff --check pass.
  • Initial GitHub runs passed the host self-test, native unit tests, four other firmware builds and large-file checks. LC_Hotfire alone failed on committed merge-conflict markers. Follow-up commit b42f7541 removes those markers while retaining board ID 41, matching the DAQ configuration. The load-cell firmware now builds locally. Both push and pull-request Firmware CI reruns pass all seven jobs (five firmware builds, native unit tests and sanitized self-test); the large-file check also passes. Successful PR run.

Integration limits

This PR is reviewable as portable, host-tested self-test infrastructure. It does not yet run on the STM32. The checkout lacks a complete target build and the hardware transport, ADC and telemetry adapters. Existing generated SPI configuration also needs correction before integration. No STM32 build, hardware timing or board behavior is claimed as verified.

The probes check communication and limited internal status/calibration integrity. They do not prove sensor accuracy, network/RF connectivity or flight readiness. Generated startup settings, state transitions, storage contents and actuator controls are unchanged.

Follow-up questions for Inez: #137. That issue should remain open after this PR merges until the hardware and interface decisions are recorded.

Add bounded probe scheduling, battery validity and heartbeat contracts, five datasheet-backed SPI checks, host tests, CI and component mapping. Hardware adapters and STM32 task integration remain explicit follow-up work.
Remove committed conflict markers while retaining board ID 41, matching the DAQ server configuration. This restores configuration parsing for the failing firmware CI job.
@inez9

inez9 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

i will review this tonight!

@inez9
inez9 merged commit 88ca4c0 into inez/flight_computer Oct 26, 2026
15 checks passed
@inez9
inez9 deleted the pranay/self-test-driver-seam branch October 26, 2026 19:19
inez9 pushed a commit that referenced this pull request Oct 29, 2026
)

* feat: add portable flight-computer self-test checks

Add bounded probe scheduling, battery validity and heartbeat contracts, five datasheet-backed SPI checks, host tests, CI and component mapping. Hardware adapters and STM32 task integration remain explicit follow-up work.

* fix: resolve load-cell PlatformIO configuration conflict

Remove committed conflict markers while retaining board ID 41, matching the DAQ server configuration. This restores configuration parsing for the failing firmware CI job.
inez9 pushed a commit that referenced this pull request Nov 3, 2026
)

* feat: add portable flight-computer self-test checks

Add bounded probe scheduling, battery validity and heartbeat contracts, five datasheet-backed SPI checks, host tests, CI and component mapping. Hardware adapters and STM32 task integration remain explicit follow-up work.

* fix: resolve load-cell PlatformIO configuration conflict

Remove committed conflict markers while retaining board ID 41, matching the DAQ server configuration. This restores configuration parsing for the failing firmware CI job.
inez9 added a commit that referenced this pull request Nov 3, 2026
* cubemx setup

* update pins on cube mx

* More changes

* Add portable flight-computer self-test and datasheet-backed checks (#138)

* feat: add portable flight-computer self-test checks

Add bounded probe scheduling, battery validity and heartbeat contracts, five datasheet-backed SPI checks, host tests, CI and component mapping. Hardware adapters and STM32 task integration remain explicit follow-up work.

* fix: resolve load-cell PlatformIO configuration conflict

Remove committed conflict markers while retaining board ID 41, matching the DAQ server configuration. This restores configuration parsing for the failing firmware CI job.

* firmware: match flight-computer .ioc to the rev 1 schematic

- Pyro 1: PYRO_1_EN (PC14) is now an output starting low and
  PYRO_1_PG (PC15) an input, matching the TPS25974 and pyro 2.
- ALT_ARM_SET/RESET (PB6/PB7) start high: the optos are active-low,
  so driving them low at boot armed the altimeter.
- Chip selects PD5/PD6/PD7/PE4/PE14 start high.
- GPS_RST (PD11) is open-drain and starts released.
- SPI1-4: 8-bit frames; SX1262 mode 0 ~8 MHz, W5500 mode 0 ~16 MHz,
  sensor bus mode 3 ~8 MHz, SD NAND mode 0 250 kHz for init.
- UART9 at 38400 (u-blox M10 default).
- ADC1 sampling 387.5 cycles for the TLV9004-buffered inputs.
- Label PD12/PD13 SPARE_I2C (I2C4 goes to J4, not the GPS).

Generated code is not regenerated yet; open in CubeMX and generate.

* format.sh: skip CubeMX-generated files in firmware/Core

main, freertos and stm32h7xx_* files are regenerated by STM32CubeMX from
firmware.ioc in its own style, so clang-formatting them fails again on the
next Generate Code. Hand-written self_test* files are still checked.

* ci: pin DAQ Playwright E2E job to ubuntu-24.04

ubuntu-latest moved to Ubuntu 26.04 and Playwright 1.59 has no Chromium
build for it, so 'npx playwright install chromium' fails before any test
runs. Pin until @playwright/test supports 26.04.

---------

Co-authored-by: inez9 <inez9@berkeley.edu>
Co-authored-by: Pranay Dogra <63373660+pranayD21@users.noreply.github.com>
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