Skip to content

firmware: eMMC flight log, recording from ARMED - #166

Merged
inez9 merged 1 commit into
mainfrom
inez/emmc
Nov 5, 2026
Merged

inez9 merged 1 commit into
mainfrom
inez/emmc

Conversation

@inez9

@inez9 inez9 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Adds the flight computer's eMMC (U9, KIOXIA THGBMTG5D1LBAIL, 4 GB) flight log, following the Flight_computer.drawio state machine. At this stage recording starts at ARMED, not LAUNCHED, because launch detection does not exist yet. Self-test and Idle never read or write the card.

  • flight_state: the diagram's transition table and which states record. A stand-in for the real state machine (Add portable Idle state logic with heartbeat, battery and host tests #162).
  • emmc_log: append-only raw-block log, no filesystem. Every 512 B block carries an epoch, its own position, its session and a CRC32, so a power cut can only lose the chunk in flight. The end is found at mount by binary search. Sensor tasks never wait on the card: records go into 16 KB RAM chunks; one writer task does all I/O; when full, records are dropped, counted and reported.
  • emmc_card: CID/EXT_CSD checks against the datasheet.
  • emmc_port: the seam, so the log runs on a laptop against a RAM disk.
  • emmc_stm32: SDMMC1 + IDMA adapter. NOT YET COMPILED (the build comes with firmware: STM32 flight computer builds and uploads from PlatformIO #165); its DMA buffers need a RAM_D1 linker section first.
  • tests/emmc: 3 host suites, new CI job stm32-emmc-host. Five deliberate breaks of the code were each caught by the matching test.
  • EMMC-ARCHITECTURE.md: design, datasheet facts, integration status.

Datasheet: https://datasheet.lcsc.com/datasheet/pdf/ea386c834ed06c7e4629df6606f52741.pdf Refs #137

Adds the flight computer's eMMC (U9, KIOXIA THGBMTG5D1LBAIL, 4 GB) flight
log, following the Flight_computer.drawio state machine. At this stage
recording starts at ARMED, not LAUNCHED, because launch detection does not
exist yet. Self-test and Idle never read or write the card.

- flight_state: the diagram's transition table and which states record.
  A stand-in for the real state machine (#162).
- emmc_log: append-only raw-block log, no filesystem. Every 512 B block
  carries an epoch, its own position, its session and a CRC32, so a power
  cut can only lose the chunk in flight. The end is found at mount by
  binary search. Sensor tasks never wait on the card: records go into
  16 KB RAM chunks; one writer task does all I/O; when full, records are
  dropped, counted and reported.
- emmc_card: CID/EXT_CSD checks against the datasheet.
- emmc_port: the seam, so the log runs on a laptop against a RAM disk.
- emmc_stm32: SDMMC1 + IDMA adapter. NOT YET COMPILED (the build comes
  with #165); its DMA buffers need a RAM_D1 linker section first.
- tests/emmc: 3 host suites, new CI job stm32-emmc-host. Five deliberate
  breaks of the code were each caught by the matching test.
- EMMC-ARCHITECTURE.md: design, datasheet facts, integration status.

Datasheet: https://datasheet.lcsc.com/datasheet/pdf/ea386c834ed06c7e4629df6606f52741.pdf
Refs #137
@inez9
inez9 merged commit a2414df into main Nov 5, 2026
21 checks passed
@inez9
inez9 deleted the inez/emmc branch November 5, 2026 10:20
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.

1 participant