Skip to content

Mirror F Prime events into cFE EVS: explicit AppID + Os_Task_Cfs (cFE ES child tasks) - #23

Merged
LeStarch merged 4 commits into
fprime-community:develfrom
JPL-Devin:devin/1755105000-evs-mirror-os-task-cfs
Aug 14, 2026
Merged

LeStarch merged 4 commits into
fprime-community:develfrom
JPL-Devin:devin/1755105000-evs-mirror-os-task-cfs

Conversation

@lestarch-autobot

@lestarch-autobot lestarch-autobot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

F Prime events mirrored by EvsMirror never reached cFE EVS: F Prime tasks are raw pthreads with no cFE ES task record, so CFE_EVS_SendEvent failed with CFE_EVS_APP_ILLEGAL_APP_ID (0xc2000003) — and even an explicit-AppID workaround was silently dropped, because EVS_IsFiltered -> CFE_EVS_GetTypeEnable re-resolves the calling task via CFE_ES_GetAppID. Fix the root cause instead:

New Os_Task_Cfs implementation (FPrimeCfs/Os/Cfs/): F Prime tasks are created via CFE_ES_CreateChildTask instead of pthreads, so every F Prime task has an ES record and cFE APIs — including plain CFE_EVS_SendEvent — resolve the calling task's app context. EvsMirror is unchanged from devel. Select per deployment with fprime_target_implementations("<deployment>" Os_Task_Cfs). Key design points (full SDD in FPrimeCfs/Os/Cfs/docs/sdd.md):

  • The cFE child task entry point takes no argument, so the routine/argument pair is delivered through a serialized static handoff slot with an atomic handshake; start() blocks (bounded, 10 s) until the child consumes its pair.
  • Priorities pass through directly as OSAL/cFS priorities (lower = more urgent), clamped to [1, 255]; default 200 when unspecified. CfsCoreConfig subtopology priorities move to cFS semantics accordingly (cmdDisp 140, health 150, events 160, tlmSend 170).
  • Task names are truncated to their trailing OS_MAX_API_NAME - 1 chars (with a warning) to satisfy OSAL limits.
  • join() polls CFE_ES_GetTaskInfo (cFE has no native join); child tasks exit via CFE_ES_ExitChildTask(); suspend()/resume() assert (no cFE API; matches Posix behavior).
  • Constraint: CFE_ES_CreateChildTask may only be called from the app's main task — F Prime topology setup runs there, so active-component starts satisfy it.

Also syncs the ComCfg override with fprime devel (saIndex, FW_PACKET_PARAM) and updates the SchAppDriver UT for new Fw::Buffer semantics.

Companion PR: fprime-community/fprime_app#14 (selects Os_Task_Cfs and updates topology priorities).

Testing

  • 11 new unit tests (FPrimeCfs_Os_Cfs_Task_ut_exe); full fprime_cfs suite 141/141 passing.
  • Runtime validation on fprime_cfs_reference: every GDS cmdDisp.CMD_NO_OP prints mirrored FPRIME_APP lines on the cFS console via plain CFE_EVS_SendEvent (OpCodeDispatched/NoOpReceived/OpCodeCompleted); zero mirror errors; F Prime GDS, cFS GroundSystem, and the fprime-cfs helper all regression-tested clean.

Note: the residual cFE behavior (CFE_EVS_GetTypeEnable ignoring an explicitly supplied AppID's AppDataPtr) resembles but is distinct from nasa/cFE#2663; the ES child-task approach sidesteps it entirely.

devin-ai-integration Bot and others added 2 commits August 13, 2026 22:15
…captured at init

CFE_EVS_SendEvent resolves the calling task's application context, but the
TextLogger handler runs on F Prime threads with no ES task record, so every
mirrored event failed with CFE_EVS_APP_ILLEGAL_APP_ID. Capture the app ID on
the app's main task in an init() override and send with it instead.

Also sync the ComCfg override with fprime devel (saIndex, FW_PACKET_PARAM)
and update the SchAppDriver UT for the new Fw::Buffer setData semantics.

Co-Authored-By: michael.d.starch <michael.d.starch@jpl.nasa.gov>
F Prime tasks were raw pthreads unknown to cFE ES, so any cFE API
resolving the calling task's app context failed (e.g. EVS filtering
dropped mirrored events). Os_Task_Cfs creates tasks via
CFE_ES_CreateChildTask so every F Prime task has an ES record.

CfsCore subtopology priorities move to cFS/OSAL semantics
(lower = more urgent).

Co-Authored-By: michael.d.starch <michael.d.starch@jpl.nasa.gov>
devin-ai-integration Bot and others added 2 commits August 13, 2026 23:35
With Os_Task_Cfs, F Prime tasks are ES-registered child tasks, so EVS
resolves the calling task's app context and the explicit-AppID capture
is no longer needed.

Co-Authored-By: michael.d.starch <michael.d.starch@jpl.nasa.gov>
Pass the (offset) name pointer directly to CFE_ES_CreateChildTask instead
of copying into a local buffer.

Co-Authored-By: michael.d.starch <michael.d.starch@jpl.nasa.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants