feat(firmware): validate configuration and migrate sensor-driven flight APIs

Validate configuration through its owning schemas and keep board
declarations separate from shared F722 resource ownership. Bound USB
transitions, isolate transport failures and retain restart-only activation.

Migrate navigation and flight consumers with the sensor and schema
contracts. Require explicit installation data and synchronous output
authority; board motor outputs remain inhibited.

Validation: assembled-prefix host tests, strict Clippy, platform/USB tests
and both ARM release builds. Final-source coverage and scoped Miri/Kani
evidence are retained separately from hardware qualification.
This commit is contained in:
Onur Özkan committed 2026-11-07 18:12:11 +03:00
1 parent fb1b8af2d1
commit f9a61a086f
211 files changed
+45657 -12740

No files matched your search

@@ -0,0 +1,32 @@
#![cfg_attr(target_os = "none", no_std)]
#![cfg_attr(target_os = "none", no_main)]
#[cfg(target_os = "none")]
mod support;
#[cfg(target_os = "none")]
mod target {
use platform_stm32f7::kaptan_ports::PortCatalog;
use platform_stm32f7::*;
pub struct Board;
impl F7Board for Board {
type UserConfig = super::support::UserConfig;
type ImmutableConfig = F722ImmutableConfig<Icm42688Spi3>;
const FACTORY_USER_CONFIG: Self::UserConfig = super::support::FACTORY;
const IMMUTABLE_CONFIG: Self::ImmutableConfig = F722ImmutableConfig {
name: "synthetic ICM dual UART",
service_hz: 100,
hardware: F722Hardware::new(
Icm42688Spi3 {
mount: ImuMount::Yaw180,
},
SerialInventory::new(&super::support::Both::DESCRIPTORS),
StatusLed::ActiveLowPd2,
VerticalSensor::None,
MotorPins::Four,
),
};
}
}
#[cfg(target_os = "none")]
platform_stm32f7::flight_firmware!(crate::target::Board);
#[cfg(not(target_os = "none"))]
fn main() {}
@@ -0,0 +1,38 @@
#![cfg_attr(target_os = "none", no_std)]
#![cfg_attr(target_os = "none", no_main)]
#[cfg(target_os = "none")]
mod support;
#[cfg(target_os = "none")]
mod target {
use platform_stm32f7::kaptan_ports::PortCatalog;
use platform_stm32f7::*;
pub struct Board;
impl F7Board for Board {
type UserConfig = super::support::UserConfig;
type ImmutableConfig = F722ImmutableConfig<Mpu6000Spi1>;
const FACTORY_USER_CONFIG: Self::UserConfig = super::support::FACTORY;
const IMMUTABLE_CONFIG: Self::ImmutableConfig = F722ImmutableConfig {
name: "synthetic MPU dual UART",
service_hz: 100,
hardware: F722Hardware::new(
Mpu6000Spi1 {
mount: ImuMount::BodyAligned,
config: Mpu6000Config {
accelerometer: AccelerometerRange::PlusMinus4G,
gyroscope: GyroscopeRange::PlusMinus500DegreesPerSecond,
digital_low_pass_filter: DigitalLowPassFilter::Bandwidth42Hz,
sample_rate_divider: 9,
},
},
SerialInventory::new(&super::support::Both::DESCRIPTORS),
StatusLed::ActiveHighPa13,
VerticalSensor::None,
MotorPins::Four,
),
};
}
}
#[cfg(target_os = "none")]
platform_stm32f7::flight_firmware!(crate::target::Board);
#[cfg(not(target_os = "none"))]
fn main() {}
@@ -0,0 +1,11 @@
//! UART catalog for compile-check examples.
use platform_stm32f7::{
F722UserConfig, UART1, UART2,
kaptan_ports::{PortCatalog, PortDescriptor},
};
pub struct Both;
impl PortCatalog<2> for Both {
const DESCRIPTORS: [PortDescriptor; 2] = [UART1, UART2];
}
pub type UserConfig = F722UserConfig<Both, 2>;
pub const FACTORY: UserConfig = UserConfig::FACTORY;