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
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@
[submodule "apps/sch_lab"]
path = apps/sch_lab
url = https://github.com/nasa/sch_lab.git
[submodule "apps/ci_lab"]
path = apps/ci_lab
url = https://github.com/nasa/ci_lab.git
branch = main
[submodule "apps/to_lab"]
path = apps/to_lab
url = https://github.com/nasa/to_lab.git
branch = main
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,26 @@ 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.
The system also includes the standard cFS lab apps:

- `sch_lab`: publishes the 1 Hz tick that drives the F Prime application's rate groups
- `ci_lab`: command ingest, receiving cFS command packets over UDP (port `1234`)
- `to_lab`: telemetry output, forwarding subscribed software bus telemetry over UDP (port `2234`)

`ci_lab` and `to_lab` give the [cFS GroundSystem](https://github.com/nasa/cFS-GroundSystem)
a direct path to the software bus; `to_lab` is subscribed to the F Prime packetized
telemetry message (`0x0820`) in `fprime_cfs_reference_defs/tables/cpu1_to_lab_sub.c`.

```mermaid
flowchart LR
fprime_app(("fprime_app")) --- Bus[cFS Messaging Bus]
fprime_gds(("fprime_gds")) --- Bus
sch_lab(("sch_lab")) --- Bus
ci_lab(("ci_lab")) --- Bus
to_lab(("to_lab")) --- Bus
gds["F Prime GDS"] --- fprime_gds
cfsgds["cFS GroundSystem"] -- "UDP :1234" --> ci_lab
to_lab -- "UDP :2234" --> cfsgds
```

## Setup
Expand Down Expand Up @@ -75,4 +85,16 @@ The reference hosts a TCP server for the GDS to connect on port `15010`. The GDS
fprime-gds --ip-port 15010 --dictionary ./build-artifacts/exe/Linux/fprime_app/dict/*Dictionary.json -n --ip-client
```

## Running the cFS GroundSystem

The cFS GroundSystem can command and monitor the system directly through `ci_lab` and
`to_lab` using the `fprime-cfs` tooling from the
[fprime_cfs](https://github.com/fprime-community/fprime_cfs) library:

```bash
fprime-cfs --dictionary ./build-artifacts/exe/Linux/fprime_app/dict/*Dictionary.json \
--ground-system-dir tools/cFS-GroundSystem \
--deployment build-artifacts/exe/cpu1 --app build-artifacts/exe/cpu1/core-cpu1
```

Enjoy!
1 change: 1 addition & 0 deletions apps/ci_lab
Submodule ci_lab added at f5d366
1 change: 1 addition & 0 deletions apps/to_lab
Submodule to_lab added at 38f731
2 changes: 2 additions & 0 deletions fprime_cfs_reference_defs/cpu1_cfe_es_startup.scr
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ 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;
CFE_APP, ci_lab, CI_LAB_AppMain, CI_LAB, 60, 16384, 0x0, 0;
CFE_APP, to_lab, TO_LAB_AppMain, TO_LAB, 70, 16384, 0x0, 0;
!
! Startup script fields:
! 1. Object Type -- CFE_APP for an Application, or CFE_LIB for a library.
Expand Down
28 changes: 28 additions & 0 deletions fprime_cfs_reference_defs/tables/cpu1_to_lab_sub.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
** Mission override of the to_lab subscription table.
**
** Subscribes TO_LAB to the F Prime packetized telemetry stream so the
** cFS GroundSystem receives it directly over UDP. The fprime_app telemetry
** framing produces space packets with the secondary header flag set, so the
** message ID is the secondary header flag (0x0800) plus the packetized
** telemetry APID (ComCfg.Apid.FW_PACKET_PACKETIZED_TLM = 0x020, chosen to
** stay clear of the default cFE core housekeeping telemetry topics).
*/

#include "cfe_tbl_filedef.h" /* Required to obtain the CFE_TBL_FILEDEF macro definition */
#include "cfe_sb_api_typedefs.h"
#include "to_lab_tbl.h"
#include "cfe_msgids.h"

#include "to_lab_msgids.h"

/* F Prime packetized telemetry: secondary header flag + APID 0x020 (see fprime_app) */
#define FPRIME_PACKETIZED_TLM_MID 0x0820

TO_LAB_Subs_t Subscriptions = { .Subs = {
{ CFE_SB_MSGID_WRAP_VALUE(FPRIME_PACKETIZED_TLM_MID), { 0, 0 }, 4 },

/* CFE_SB_MSGID_RESERVED entry to mark the end of valid MsgIds */
{ CFE_SB_MSGID_RESERVED, { 0, 0 }, 0 } } };

CFE_TBL_FILEDEF(Subscriptions, TO_LAB.Subscriptions, TO Lab Sub Tbl, to_lab_sub.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 sch_lab)
list(APPEND MISSION_GLOBAL_APPLIST fprime fprime_cfs fprime_app fprime_gds sch_lab ci_lab to_lab)

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