Fenrir
Source of truth for Fenrir hardware capabilities, specs, pinout, interfaces, and sensors.
Pass criteria for first launch: All sensors read, processed, stored in frames and/or transmitted over LoRa.

Component overview
- Deadline: 2 months
- Bring-up pass criteria: Store and/or transmit sensor data in frames
Hardware
MCU: STM32U5
HSE: 50 MHz external crystal on PH0/PH1
LSE: 32.768 kHz external crystal on PC14/PC15
SYSCLK source: PLL from HSE
Notes: Target SYSCLK up to 160 MHz. Power and PVD levels TBD during bring-up.
GPIO Map & Safety
Pins are grouped by purpose and include boot-order invariants. Safety-critical outputs are initialized LOW.
| Pin | Name | Direction | Signal | Function / Default |
|---|---|---|---|---|
| PH3 | Boot0 (Debug_LED2) | Output | GPIO_Output | Boot strap. Default: LOW |
| PD4 | HP_GPO_0 | Output | GPIO_Output | Rocket ignition. INIT SAFE LOW |
| PD5 | HP_GPO_1 | Output | GPIO_Output | Rocket ignition. INIT SAFE LOW |
| PD6 | HP_GPO_2 | Output | GPIO_Output | Rocket ignition. INIT SAFE LOW |
| PD7 | HP_GPO_3 | Output | GPIO_Output | Rocket ignition. INIT SAFE LOW |
| PA8 | HP_Enable | Output | GPIO_Output | High power rail enable. INIT SAFE LOW |
Sensors & Interfaces
| Sensor | Interface | Address / CS | Purpose |
|---|---|---|---|
| BMI270 #0 | SPI1 | CS = PD8 | IMU (accel + gyro) |
| BMI270 #1 | SPI1 | CS = PD9 | IMU (accel + gyro) |
| AK09918 (A31301) | SPI1 | CS = PD10 | Magnetometer (heading) |
| BME690 | I2C1 | 0x76 | Humidity / Temp / Pressure / Gas |
| BMP581 | I2C1 | 0x46 | High-accuracy barometer |
| INA219AIDR | I2C1 | 0x40 | Current monitor / power budgeting |
IMU Mounting
IMU0 and IMU1 are deliberately offset for fusion:
- IMU_0 = (0, 0) mm
- IMU_1 = (2, 4) mm
Power & Storage
Monitor IC: INA219AIDR on I2C1 at 0x40
SD: SDMMC1 used for data logging; card detect and activity LED pins present.
Software Architecture
Layered design: Application → Drivers → Fenrir HAL → STM32 registers. HAL shims are used during bring-up; long-term goal is Fenrir HAL owning peripheral configuration and runtime behavior.
Design rules: one folder per concern, one file per job, mission logic isolated from scheduler/runtime, thin HAL wrappers, test-first bring-up progression.
Estimator & Fusion (Summary)
The Virtual Pose Sensor fuses dual IMU accel/gyro, magnetometer heading, and barometric altitude. Uses complementary blending of gyro integration and accelerometer tilt with magnetometer correction. Barometer provides long-term altitude stability while accelerometer dead reckoning provides short-term responsiveness.
Sensor validation: range checks, timeout detection, frozen-value detection, and innovation residual monitoring. Invalidated sensors are excluded from fusion; if all pose sources fail, system enters a safe LIMP_HOME state.

