Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@
[submodule "libs/fprime_cfs"]
path = libs/fprime_cfs
url = https://github.com/fprime-community/fprime_cfs.git
[submodule "apps/sch_lab"]
path = apps/sch_lab
url = https://github.com/nasa/sch_lab.git
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ This repository contains a minimal cFS system that demonstrates the use of cFS a
1. `fprime_app`: A simple demonstration app showing how to construct cFS applications using F Prime
2. `fprime_gds`: An application that bridges the F Prime GDS to the cFS messaging bus

The system also includes the standard cFS `sch_lab` scheduler app, which publishes the 1 Hz tick
that drives the F Prime application's rate groups.


```mermaid
flowchart LR
fprime_app(("fprime_app")) --- Bus[cFS Messaging Bus]
fprime_gds(("fprime_gds")) --- Bus
sch_lab(("sch_lab")) --- Bus
gds["F Prime GDS"] --- fprime_gds
```

Expand Down Expand Up @@ -51,6 +55,11 @@ make install

## Running the Reference

> [!NOTE]
> The F Prime application's rate groups are driven by a 1 Hz tick message (command MID `0x1890`,
> APID `0x090`) published by the `sch_lab` scheduler app included in this system. The schedule is
> configured in `fprime_cfs_reference_defs/tables/cpu1_sch_lab_table.c`.

The build is installed in `build-artifacts/exe/cpu1/`. You can run the reference system using the following command:

```bash
Expand Down
1 change: 1 addition & 0 deletions apps/sch_lab
Submodule sch_lab added at bfc82a
1 change: 1 addition & 0 deletions fprime_cfs_reference_defs/cpu1_cfe_es_startup.scr
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CFE_LIB, cfe_assert, CFE_Assert_LibInit, ASSERT_LIB, 0, 0, 0x0, 0;
CFE_APP, sch_lab, SCH_LAB_AppMain, SCH_LAB, 30, 16384, 0x0, 0;
CFE_APP, fprime_gds, FPRIME_GDS_Main, FPRIME_GDS, 25, 16384, 0x0, 0;
CFE_APP, fprime_app, FPRIME_APP_Main, FPRIME_APP, 25, 65536, 0x0, 0;
!
Expand Down
27 changes: 27 additions & 0 deletions fprime_cfs_reference_defs/tables/cpu1_sch_lab_table.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
** Mission override of the sch_lab schedule table.
**
** Publishes the F Prime tick message: a cFS command with MID 0x1890
** (command type bit + secondary header flag + APID 0x090, function code 0)
** once per second. The fprime_app CfsBridge subscribes to this message and
** routes it to the SchAppDriver, which cycles the F Prime rate groups.
*/

#include "cfe_tbl_filedef.h" /* Required to obtain the CFE_TBL_FILEDEF macro definition */
#include "sch_lab_tbl.h"
#include "cfe_sb_api_typedefs.h" /* Required to use the CFE_SB_MSGID_WRAP_VALUE macro */

#include "cfe_msgids.h"

/* F Prime tick: command MID for APID 0x090 (see fprime_app) */
#define FPRIME_TICK_MID 0x1890

SCH_LAB_ScheduleTable_t Schedule = {
.TickRate = 100, /* 100 timer ticks per second */
.Config = {
/* Send the F Prime tick once per second (every 100 ticks) */
{CFE_SB_MSGID_WRAP_VALUE(FPRIME_TICK_MID), 100, 0},
}
};

CFE_TBL_FILEDEF(Schedule, SCH_LAB.Schedule, Schedule Lab MsgID Table, sch_lab_table.tbl)
2 changes: 1 addition & 1 deletion fprime_cfs_reference_defs/targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ SET(SPACECRAFT_ID 0x42)
# and must be loaded explicitly via startup script or command.
# This list is effectively appended to every TGTx_APPLIST in targets.cmake.
# Example:
list(APPEND MISSION_GLOBAL_APPLIST fprime fprime_cfs fprime_app fprime_gds)
list(APPEND MISSION_GLOBAL_APPLIST fprime fprime_cfs fprime_app fprime_gds sch_lab)

# The "MISSION_GLOBAL_STATIC_APPLIST" is similar to MISSION_GLOBAL_APPLIST
# but the apps are statically linked.
Expand Down
Loading