Skip to content

Sd 22337 monarch fine grained control real time telemetry selection feature - #19

Open
stevencarpenter102 wants to merge 199 commits into
monarchfrom
SD-22337-monarch-fine-grained-control-real-time-telemetry-selection-feature
Open

Sd 22337 monarch fine grained control real time telemetry selection feature#19
stevencarpenter102 wants to merge 199 commits into
monarchfrom
SD-22337-monarch-fine-grained-control-real-time-telemetry-selection-feature

Conversation

@stevencarpenter102

@stevencarpenter102 stevencarpenter102 commented Aug 19, 2026

Copy link
Copy Markdown
Related Issue(s) SD-22337-monarch-fine-grained-control-real-time-telemetry-selection-feature
Has Unit Tests (y/n) y
Documentation Included (y/n) n
Generative AI was used in this contribution (y/n) y

Change Description

support per-packet configuration, write out the per-packet overrides to persistent storage via a configOut port to a component of your choosing which manages the storage; at boot-up pull in config written to persistent storage via configIn port

Rationale

facilitates "finer-grain" control of packet telemetry configuration (rather than the more "coarse" control at the TlmPacketizer's group-level); this "finer-grain" per-packet control is being requested from some of FF's missions

Testing/Review Recommendations

  • testing focused on use of the 'bg2_flight' deployment w/ Linux + mpac builds on local laptop + Racksat hardware
  • confirmed w/ fsw binary running that ENABLE_PACKET() and FORCE_PACKET() influence run-time behavior as expected

Future Work

n/a

AI Usage (see policy)

understood

@stevencarpenter102 stevencarpenter102 self-assigned this Aug 25, 2026

@ Maximum number of per-packet config entries carried in a single push batch.
@ Sized so one fully-serialized batch stays well within FW_COM_BUFFER_MAX_SIZE.
constant TLM_PACKET_CONFIG_BATCH_MAX = 32

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note this "batched config write" feature is required b/c of the FW_COM_BUFFER_MAX_SIZE (~2k) limitation means we can only send out the configOut port so many per-packet override configs serialized at a time...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be moved to TlmPackizerCfg.fpp

this->invoke_to_TlmRecv(0, 100, ts, buff); // second channel
buff.resetSer();
(void)buff.serializeFrom(static_cast<U8>(14));
this->invoke_to_TlmRecv(0, 333, ts, buff); // third channel

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skipping the fourth channel is intentionally...following same pattern of skipping found in many other unit tests throughout this file

return outIndex;
}

Svc::PacketConfig TlmPacketizer::effectiveConfig(FwIndexType section, FwChanIdType pkt, FwChanIdType group) const {

@stevencarpenter102 stevencarpenter102 Aug 25, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"effective" in the sense of prioritize the per-packet override...and if there's none -> then use the group config of which the packet is a part

rateLogic: RateLogic @< Rate logic
minDelta: U32 @< Minimum Sched ticks between sends (ON_CHANGE_MIN logic)
maxDelta: U32 @< Maximum Sched ticks between sends (EVERY_MAX logic)
) \

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the three functions above mirror the same functionality available for the "group"-level...now we're exposes the "per-packet" more 'fine-grain' level

telemetry SectionEnabled: SectionEnabled id 1

@ Effective per-packet configuration, emitted in response to GET_PACKET_CONFIG
telemetry QueriedPacketConfig: PacketConfigEntry id 2

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notice the comment here...esp useful for debugging


@ Per-packet configuration reload from the persistence storage component
@ That storage component pushes it's config into this port when commanded to do so (usually at boot-up)
async input port configIn: TlmPacketConfigUpdate

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was motivated by the use-case...

somehow the TlmPacketizer needs to get the persisted packet-overrides after a reboot...this port is the way you get this config in here

async command GET_PACKET_CONFIG(
packetId: U32 @< Packet identifier
section: TelemetrySection @< Section to query
) \

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after sending this command check the QueriedPacketConfig telemetry channel for the latest packet config asked for!

//! CONFIGURE_PACKET_RATES commands. When m_packetOverridden is set, this value wins over
//! the group-derived policy for that packet/section. This is the per-packet control layer;
//! group config remains the base for non-overridden packets. Each change is mirrored out
//! configOut to the passive TlmPacketConfig for persistence.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

packet override >> group policy

rateLogic: RateLogic @< Rate logic configuration
min: U32 @< Minimum Sched ticks between sends when using ON_CHANGE_MIN logic
max: U32 @< Maximum Sched ticks between sends when using EVERY_MAX logic
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PacketConfig mirrors the struct GroupConfig

@Brian-Campuzano Brian-Campuzano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend updating the SDD to keep track of how packet level overrides interact with the existing "knobs". Also need to update the component port interface definition.


@ Maximum number of per-packet config entries carried in a single push batch.
@ Sized so one fully-serialized batch stays well within FW_COM_BUFFER_MAX_SIZE.
constant TLM_PACKET_CONFIG_BATCH_MAX = 32

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be moved to TlmPackizerCfg.fpp

}
s = static_cast<FwSizeType>(section.e);
if (not this->m_packetOverridden[s][pkt]) {
this->m_packetOverride[s][pkt] = TlmPacketizer::defaultPacketConfig();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be overriding with the effectiveConfig() instead of the defaultPacketConfig()?

Comment on lines +651 to +652
if (this->m_packetOverridden[s][pkt]) {
return this->m_packetOverride[s][pkt];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once a packet has been overridden, how is it cleared? Do we need a new command?

Comment on lines +654 to +662
// Not overridden: derive from the group policy for this packet's level (legacy behavior).
const TlmPacketizer_GroupConfig& gc = this->m_groupConfigs[s][group];
Svc::PacketConfig eff;
eff.set_enabled(gc.get_enabled());
eff.set_forceEnabled(gc.get_forceEnabled());
eff.set_rateLogic(gc.get_rateLogic());
eff.set_min(gc.get_min());
eff.set_max(gc.get_max());
return eff;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the return on 652 is building/copying a new PacketConfig and returning by value every evaluation cycle. Consider refactoring to return a reference a performance improvement.

void TlmPacketizer ::configIn_handler(FwIndexType portNum, FwSizeType count, const Svc::PacketConfigBatch& batch) {
// load overrides from an external component's persistant storage of the overrides (intended to be used after a reboot)
const FwSizeType cap = static_cast<FwSizeType>(Svc::PacketConfigBatch::SIZE);
const FwSizeType n = (count < cap) ? count : cap;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider a warning EVR if the cap is exceeded.

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.

4 participants