diff --git a/satrs-book/src/SUMMARY.md b/satrs-book/src/SUMMARY.md index 5ec4413..85a0ca8 100644 --- a/satrs-book/src/SUMMARY.md +++ b/satrs-book/src/SUMMARY.md @@ -12,11 +12,11 @@ - [Housekeeping Data](./housekeeping.md) - [Events](./events.md) +# Architecture + +- [System View](./system-view.md) +- [Design](./design.md) + # Example project - [The satrs-example application](./example.md) - -# Additional information - -- [Design](./design.md) - diff --git a/satrs-book/src/images/.gitignore b/satrs-book/src/images/.gitignore new file mode 100644 index 0000000..8d71bf9 --- /dev/null +++ b/satrs-book/src/images/.gitignore @@ -0,0 +1 @@ +*.bkp diff --git a/satrs-book/src/images/satrs-arch-embassy.drawio b/satrs-book/src/images/satrs-arch-embassy.drawio new file mode 100644 index 0000000..2614303 --- /dev/null +++ b/satrs-book/src/images/satrs-arch-embassy.drawio @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/satrs-book/src/images/satrs-arch-embassy.drawio.png b/satrs-book/src/images/satrs-arch-embassy.drawio.png new file mode 100644 index 0000000..05576ee Binary files /dev/null and b/satrs-book/src/images/satrs-arch-embassy.drawio.png differ diff --git a/satrs-book/src/images/satrs-arch-generic.drawio b/satrs-book/src/images/satrs-arch-generic.drawio new file mode 100644 index 0000000..6d92c79 --- /dev/null +++ b/satrs-book/src/images/satrs-arch-generic.drawio @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/satrs-book/src/images/satrs-arch-generic.drawio.png b/satrs-book/src/images/satrs-arch-generic.drawio.png new file mode 100644 index 0000000..e5ed605 Binary files /dev/null and b/satrs-book/src/images/satrs-arch-generic.drawio.png differ diff --git a/satrs-book/src/images/satrs-arch-linux.drawio b/satrs-book/src/images/satrs-arch-linux.drawio new file mode 100644 index 0000000..d2db392 --- /dev/null +++ b/satrs-book/src/images/satrs-arch-linux.drawio @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/satrs-book/src/images/satrs-arch-linux.drawio.png b/satrs-book/src/images/satrs-arch-linux.drawio.png new file mode 100644 index 0000000..84a4fb7 Binary files /dev/null and b/satrs-book/src/images/satrs-arch-linux.drawio.png differ diff --git a/satrs-book/src/system-view.md b/satrs-book/src/system-view.md new file mode 100644 index 0000000..189857d --- /dev/null +++ b/satrs-book/src/system-view.md @@ -0,0 +1,51 @@ +# System View + +This chapter gives a system level view of how a typical flight software built with `sat-rs`, +[`spacepackets`](https://egit.irs.uni-stuttgart.de/rust/spacepackets) and +[`cfdp`](https://egit.irs.uni-stuttgart.de/rust/cfdp) is layered. It complements the previous +chapters, which focus on individual components, by showing how those components fit together +and where the line between application and platform is usually drawn. + +## Generic layering + +Flight software built with `sat-rs` is generally structured into three layers. + +![Generic architecture](./images/satrs-arch-generic.drawio.png) + +- **Application**: The mission specific logic. This is the code a developer writes for a + particular mission. It covers mission logic, TMTC handling, event handling, FDIR and command + scheduling. `sat-rs` provides re-usable building blocks for all of these, but the concrete + wiring and mission behaviour lives here. +- **System / platform**: The set of services the application is built on. This covers + concepts like logging, serialization, IPC, task and memory management, hardware + access, filesystem access and time. Most of these components are provided by external libraries + and APIs. +- **Hardware**: The physical target the software runs on. + +The application layer stays largely the same across missions and targets. The system / platform +layer is where the target environment determines which concrete crates and mechanisms are used. + +## Embedded Linux + +On an embedded Linux target, the platform layer is provided by the Rust standard library and a +small set of additional crates. + +![Linux architecture](./images/satrs-arch-linux.drawio.png) + +The application layer uses `sat-rs` together with `spacepackets` for CCSDS/ECSS packet handling +and `cfdp` for file transfer. The platform layer relies on `std` for tasks, IPC, memory, time and +filesystem access, `serde` and `postcard` for serialization and `log`/`fern` for logging. Hardware +access typically goes through Linux mechanisms like `uio`. + +## Embedded async targets (Embassy / RTIC) + +On smaller microcontrollers without an operating system, the platform layer looks quite +different, even though the application layer stays the same. + +![Embassy/RTIC architecture](./images/satrs-arch-embassy.drawio.png) + +Here the platform layer is built around an async-centric executor, either +[Embassy](https://embassy.dev/) or [RTICv2](https://rtic.rs/). `alloc`-based crates like +`heapless` and `embedded-alloc` replace `std` collections and allocation, `defmt` replaces `log` +for logging and hardware access goes through a board support package (BSP), a hardware +abstraction layer (HAL) and a peripheral access crate (PAC) instead of the OS.