Skip to content

Commit de90125

Browse files
committed
sdd for startup manager
1 parent e1af709 commit de90125

File tree

1 file changed

+87
-36
lines changed
  • FprimeZephyrReference/Components/StartupManager/docs

1 file changed

+87
-36
lines changed
Lines changed: 87 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# Components::StartupManager
22

3-
Manages the start-up sequencing
3+
## Overview
4+
5+
The StartupManager component manages boot counting, quiescence waiting periods, and automatic dispatch of startup sequences.
6+
7+
## Purpose
8+
9+
The StartupManager serves three primary functions:
10+
1. Boot Counting: Tracks the number of system boots persistently across power cycles
11+
2. Implements a configurable waiting period (default 45 minutes) before allowing full system startup, useful for missions requiring initial stabilization
12+
3. Automatically dispatches and monitors the execution of startup command sequences
413

514
## Usage Examples
615
Add usage examples here
@@ -9,58 +18,100 @@ Add usage examples here
918
Add diagrams here
1019

1120
### Typical Usage
12-
And the typical usage of the component here
1321

14-
## Class Diagram
15-
Add a class diagram here
22+
## How to Run
23+
24+
1. Uplink a sequence start file. we have one in TODO location
25+
2. STARTUP_SEQUENCE_FILE_PRM_SET to the file you uplinked and STARTUP_SEQUENCE_FILE_PRM_SAVE
26+
3. FileHandling.prmDb.PRM_SAVE_FILE
27+
28+
29+
The StartupManager maintains internal state tracking its lifecycle:
30+
31+
| State | Description | Trigger |
32+
|-------|-------------|---------|
33+
| **Uninitialized** | Initial state before first `run` call. `m_boot_count == 0` | System initialization |
34+
| **Initialized** | Boot count and quiescence start time have been loaded/set | First `run` call |
35+
| **Waiting for Quiescence** | `m_waiting == true`, awaiting quiescence period expiration or disarm | `WAIT_FOR_QUIESCENCE` command received |
36+
| **Running** | Normal operation, updating telemetry on each `run` call | Continuous after initialization |
37+
38+
**State Transitions:**
39+
40+
```
41+
Uninitialized → Initialized (first run call)
42+
Initialized → Waiting for Quiescence (WAIT_FOR_QUIESCENCE command)
43+
Waiting for Quiescence → Running (quiescence period expires OR ARMED=false)
44+
```
1645

1746
## Port Descriptions
18-
| Name | Description |
19-
|---|---|
20-
|---|---|
47+
48+
| Port Name | Type | Direction | Description |
49+
|-----------|------|-----------|-------------|
50+
| `run` | `Svc.Sched` | Input (sync) | Scheduled execution port called by rate group. Manages boot initialization and quiescence monitoring |
51+
| `runSequence` | `Svc.CmdSeqIn` | Output | Port for dispatching command sequences to the command sequencer |
52+
| `completeSequence` | `Fw.CmdResponse` | Input (sync) | Receives completion status from the command sequencer after startup sequence execution |
2153

2254
## Component States
23-
Add component states in the chart below
24-
| Name | Description |
25-
|---|---|
26-
|---|---|
55+
56+
| State Variable | Type | Description |
57+
|----------------|------|-------------|
58+
| `m_boot_count` | `FwSizeType` | Current boot count. Zero indicates uninitialized state |
59+
| `m_quiescence_start` | `Fw::Time` | Time when quiescence period started (mission epoch) |
60+
| `m_waiting` | `std::atomic<bool>` | True when waiting for quiescence period to elapse |
61+
| `m_stored_opcode` | `FwOpcodeType` | Opcode of pending `WAIT_FOR_QUIESCENCE` command |
62+
| `m_stored_sequence` | `U32` | Sequence number of pending `WAIT_FOR_QUIESCENCE` command |
2763

2864
## Sequence Diagrams
29-
Add sequence diagrams here
3065

3166
## Parameters
32-
| Name | Description |
33-
|---|---|
34-
|---|---|
67+
68+
| Name | Type | Default Value | Description |
69+
|------|------|---------------|-------------|
70+
| `ARMED` | `bool` | `true` | When true, system waits for quiescence period. When false, quiescence is bypassed |
71+
| `QUIESCENCE_TIME` | `Fw.TimeIntervalValue` | `{seconds = 45 * 60, useconds = 0}` | Duration to wait for quiescence (45 minutes by default) |
72+
| `QUIESCENCE_START_FILE` | `string` | `"/quiescence_start.bin"` | File path for storing the mission-wide quiescence start time |
73+
| `STARTUP_SEQUENCE_FILE` | `string` | `"/startup.bin"` | Path to the command sequence file to run at startup |
74+
| `BOOT_COUNT_FILE` | `string` | `"/boot_count.bin"` | File path for storing the boot count |
3575

3676
## Commands
37-
| Name | Description |
38-
|---|---|
39-
|---|---|
77+
78+
| Name | Description |
79+
|------|-------------|
80+
| `WAIT_FOR_QUIESCENCE` | Lets you start with opcode cmdseq and whether or not waiting |
4081

4182
## Events
42-
| Name | Description |
43-
|---|---|
44-
|---|---|
83+
84+
| Name | Severity | Arguments | Description |
85+
|------|----------|-----------|-------------|
86+
| `BootCountUpdateFailure` | WARNING_LO | None | Emitted when the boot count file cannot be updated. Boot count was incremented in memory but not persisted |
87+
| `QuiescenceFileInitFailure` | WARNING_LO | None | Emitted when the quiescence start time file cannot be initialized. System will use current time but cannot persist it |
88+
| `StartupSequenceFinished` | ACTIVITY_LO | None | Emitted when the startup sequence completes successfully |
89+
| `StartupSequenceFailed` | WARNING_LO | `response: Fw.CmdResponse` | Emitted when the startup sequence fails, includes the failure response code |
4590

4691
## Telemetry
47-
| Name | Description |
48-
|---|---|
49-
|---|---|
5092

51-
## Unit Tests
52-
Add unit test descriptions in the chart below
53-
| Name | Description | Output | Coverage |
54-
|---|---|---|---|
55-
|---|---|---|---|
93+
| Name | Type | Update Policy | Description |
94+
|------|------|---------------|-------------|
95+
| `BootCount` | `FwSizeType` | Update on change | Current boot count. Increments on each system boot |
96+
| `QuiescenceEndTime` | `Fw.TimeValue` | Update on change | Absolute time when the quiescence period will end. Updated on each `run` call |
5697

5798
## Requirements
58-
Add requirements in the chart below
59-
| Name | Description | Validation |
60-
|---|---|---|
61-
|---|---|---|
99+
100+
| Requirement ID | Description | Validation Method |
101+
|----------------|-------------|-------------------|
102+
| REQ-SM-001 | StartupManager shall track boot count across power cycles | Verification: Check that boot count increments on each boot via telemetry |
103+
| REQ-SM-002 | StartupManager shall support configurable quiescence waiting period | Verification: Confirm QUIESCENCE_TIME parameter affects wait duration |
104+
| REQ-SM-003 | StartupManager shall automatically dispatch startup sequence on first run call | inspection |
105+
| REQ-SM-004 | StartupManager shall allow disabling quiescence via `ARMED` parameter | Verification: Set `ARMED=false` and confirm `WAIT_FOR_QUIESCENCE` completes immediately |
106+
| REQ-SM-005 | StartupManager shall emit events for sequence completion status | Verification: Monitor events during sequence execution |
107+
| REQ-SM-006 | StartupManager shall update telemetry on each run cycle | Verification: Confirm `BootCount` and `QuiescenceEndTime` telemetry updates |
108+
| REQ-SM-007 | StartupManager shall handle file I/O errors gracefully | Verification: Remove file permissions and verify warning events are emitted |
109+
110+
111+
### Unit Tests
112+
62113

63114
## Change Log
64-
| Date | Description |
65-
|---|---|
66-
|---| Initial Draft |
115+
116+
| Date | Author | Description |
117+
|------|--------|-------------|

0 commit comments

Comments
 (0)