You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
P2: deterministic ESP32-P4 Sampled Values publisher and timing evidence #21
Replace the P0/P1 slow smoke loop with a deterministic real-time Sampled Values publisher on ESP32-P4-ETH. This phase must produce measured timing evidence before relay interoperability or a large desktop UI is treated as trustworthy.
At least 60 s continuous run at 4000 fps with zero unexplained smpCnt gaps in an independent capture.
Repeat at 4800 fps.
Store machine-readable timing report plus PCAP evidence.
Protocol truthfulness
Keep smpSynch=0 until a measured synchronization source is actually locked.
Do not claim 9-2LE profile compliance until the exact dataset/field presence, channel order, scaling, quality encoding, multicast/VLAN profile and sample-rate behavior are validated against the selected profile/IED.
Exit gate
P2 is complete only when firmware build CI is green and physical timing/capture evidence demonstrates deterministic 4000/4800 fps behavior. After this gate, proceed to the 3-phase waveform/fault engine and desktop control application.
P2 implementation foundation has now landed on the stacked hardware branch/PR #19 after physical P0/P1 evidence. Current code adds a 50 Hz / 80 samples-cycle / 4000 fps absolute-deadline publisher, prebuilt fixed-size templates, generated balanced 4I+4V waveform, continuous smpCnt wrap=4000, canonical VLAN multicast plus a clearly labeled lab-only broadcast capture mirror, and scheduler/TX telemetry. Hardware acceptance for this P2 step is still open: sustained 4000 fps capture, missed-slot/jitter evidence, canonical multicast/VLAN on a suitable NIC/TAP, and hardware TX timestamps remain to be measured before this issue can be closed.
Bench update from 2026-08-10 after GPTimer scheduler + separate diagnostic mirror:
Device telemetry is stable at ~4000 samples/s with canonical TX ok=4000/s, mirror TX ok=4000/s, fail=0, missed=0, wake lateness reported 0/0/0 us in the current software metric.
A raw process-bus analyzer reconstructs balanced 50 Hz three-phase voltage/current waveforms from AR_DIAG_SV1 and reports sequence integrity CONTINUOUS / Loss OK.
The host USB-Ethernet capture path reports ~3999 fps but also arrival-time excursions above 300 us in the observed bench window even though sequence remains continuous.
Interpretation: host arrival timestamps are capture-path evidence, not trustworthy device-TX timing evidence. The next P2 timing gate should therefore be ESP32-P4 EMAC IEEE1588v2 hardware TX timestamps and/or a trusted independent reference capture, not tuning the GPTimer loop to compensate for host buffering/batching.
diagnostic mirror remains outside the canonical timing statistics;
records valid/invalid timestamps, clock regressions, TX-to-TX period min/mean/max, signed period error vs 250 us, and bounded absolute-error P95/P99;
smpSynch=0 remains unchanged.
The embedded firmware cross-compile has passed on the pinned ESP32-P4 CI path. Physical acceptance is deliberately still open: flash PR #26 on the real board, verify non-zero hardware timestamps, then run at least 60 s at ~4000 fps with TX fail=0, missed=0 and clock_regress=0 before establishing any regression threshold. The extended timestamped transmit path waits for descriptor timestamp availability, so its runtime cost must be proven on hardware rather than inferred from compile success.
IEC 61869-9 F96000S1 is now covered by the P1.2 host semantic regression. It exposes an important runtime boundary for the timing tranche:
the wire smpCnt remains the protocol's bounded 16-bit field;
the F96000S1 sampling identity is 96 ksample/s;
therefore an internal sample epoch / second-alignment policy must not be modeled as a fictitious uint16_t modulus = 96000.
P1.2 deliberately leaves generic counter-wrap policy unresolved for the 96 kHz profile rather than inventing an impossible modulus.
When #21/#56 advance the hardware-time/epoch work, model at least:
wireSampleCounterPolicy
sampleEpochPolicy
sampleInstant / PTP time relationship
second-boundary behavior
as separate semantics.
Do not widen the on-wire counter or reinterpret it as a 17-bit/96000-modulus value. The runtime may use a wider internal absolute sample index, but wire encoding and epoch derivation remain separate authorities.
2026-10-07 timing-authority reconnaissance (no implementation overlap)
Current source shows a concrete reuse path for #21:
embedded/esp32p4_smv_injector/main/ptp_lab_task.cpp already obtains ESP32-P4 EMAC hardware TX timestamps via esp_eth_transmit_ctrl_vargs(eth_handle, &tx_timestamp, 2U, frame.data(), frame.size()), validates the returned timestamp, and uses it for PTP two-step Sync/Pdelay evidence (around lines 332–358).
Canonical SV TX in embedded/esp32p4_smv_injector/main/app_main.cpp (around lines 562–571) currently uses esp_eth_transmit() with only submit-success/failure accounting. Its scheduler's wake_late_us and successful TX return are not actual EMAC egress timestamps.
Next bounded #21 design gate: reuse/factor the existing timestamp-aware EMAC transport adapter instead of creating a second PTP clock, scheduler, or TX failure authority. Correlate immutable profile identity, smpCnt, scheduled GPTimer deadline, task wake, TX submit, and timestamped EMAC egress; validate clock-domain alignment before computing mean/min/max/P95/P99. Keep app_main.cpp as the single canonical SV transport-failure authority. Prove bounded memory/hot-path overhead and feasibility at both 4000 and 4800 fps; if timestamp acquisition is not suitable for every packet, make measurement coverage/sample policy explicit instead of reporting partial observations as full-stream jitter truth.
Acceptance remains open: physical hardware timestamp/independent-capture evidence has not been collected by this source audit. No timing/compliance claim or new code authority is added by this note.
P2 track reconciliation 24 Oct 2026: exact M3.H source is now in main via #299, baseline a922e9bd...; 4I+4V/4000fps 40.76s capture with 163,048 consecutive frames, no sequence loss, PTP lab metadata. Keep this issue OPEN for its broader original exit gate: 4800fps independent hardware capture, at least 60s continuous runs at both sample rates, physical scheduling jitter percentile evidence and machine-readable timing report. Public M3.H Stable supports only advertised 4kHz lab profile.
Release scope clarification: M3.H stable 4 kHz/4I+4V local bench build a922e9b... passed 10/10 original CI and the valid 40.76 s capture (163,048 SV; 3999.884 fps). This does not satisfy this issue's full 60 s/4800 fps/jitter evidence acceptance. Keep OPEN for remaining rate and hardware measurements. Do not transplant legacy PR #166 into the immutable M3.H firmware.
Activity
masarray commentedon Aug 10, 2026
P2 implementation foundation has now landed on the stacked hardware branch/PR #19 after physical P0/P1 evidence. Current code adds a 50 Hz / 80 samples-cycle / 4000 fps absolute-deadline publisher, prebuilt fixed-size templates, generated balanced 4I+4V waveform, continuous smpCnt wrap=4000, canonical VLAN multicast plus a clearly labeled lab-only broadcast capture mirror, and scheduler/TX telemetry. Hardware acceptance for this P2 step is still open: sustained 4000 fps capture, missed-slot/jitter evidence, canonical multicast/VLAN on a suitable NIC/TAP, and hardware TX timestamps remain to be measured before this issue can be closed.
masarray commentedon Aug 10, 2026
Bench update from 2026-08-10 after GPTimer scheduler + separate diagnostic mirror:
AR_DIAG_SV1and reports sequence integrity CONTINUOUS / Loss OK.Interpretation: host arrival timestamps are capture-path evidence, not trustworthy device-TX timing evidence. The next P2 timing gate should therefore be ESP32-P4 EMAC IEEE1588v2 hardware TX timestamps and/or a trusted independent reference capture, not tuning the GPTimer loop to compensate for host buffering/batching.
P2 status update:
Standards-first SCL/profile/PTP follow-on is tracked separately in #24.
masarray commentedon Aug 10, 2026
P2-A hardware timing implementation is now in PR #26 after the merged realtime SV foundation.
Implemented device-side evidence path:
hardware_timestamp.[ch]);smpSynch=0remains unchanged.The embedded firmware cross-compile has passed on the pinned ESP32-P4 CI path. Physical acceptance is deliberately still open: flash PR #26 on the real board, verify non-zero hardware timestamps, then run at least 60 s at ~4000 fps with TX fail=0, missed=0 and clock_regress=0 before establishing any regression threshold. The extended timestamped transmit path waits for descriptor timestamp availability, so its runtime cost must be proven on hardware rather than inferred from compile success.
masarray commentedon Oct 7, 2026
P1.2 timing handoff: wire counter != sample epoch
IEC 61869-9 F96000S1 is now covered by the P1.2 host semantic regression. It exposes an important runtime boundary for the timing tranche:
smpCntremains the protocol's bounded 16-bit field;uint16_t modulus = 96000.P1.2 deliberately leaves generic counter-wrap policy unresolved for the 96 kHz profile rather than inventing an impossible modulus.
When #21/#56 advance the hardware-time/epoch work, model at least:
as separate semantics.
Do not widen the on-wire counter or reinterpret it as a 17-bit/96000-modulus value. The runtime may use a wider internal absolute sample index, but wire encoding and epoch derivation remain separate authorities.
masarray commentedon Oct 7, 2026
2026-10-07 timing-authority reconnaissance (no implementation overlap)
Current source shows a concrete reuse path for #21:
embedded/esp32p4_smv_injector/main/ptp_lab_task.cppalready obtains ESP32-P4 EMAC hardware TX timestamps viaesp_eth_transmit_ctrl_vargs(eth_handle, &tx_timestamp, 2U, frame.data(), frame.size()), validates the returned timestamp, and uses it for PTP two-step Sync/Pdelay evidence (around lines 332–358).embedded/esp32p4_smv_injector/main/app_main.cpp(around lines 562–571) currently usesesp_eth_transmit()with only submit-success/failure accounting. Its scheduler'swake_late_usand successful TX return are not actual EMAC egress timestamps.Next bounded #21 design gate: reuse/factor the existing timestamp-aware EMAC transport adapter instead of creating a second PTP clock, scheduler, or TX failure authority. Correlate immutable profile identity,
smpCnt, scheduled GPTimer deadline, task wake, TX submit, and timestamped EMAC egress; validate clock-domain alignment before computing mean/min/max/P95/P99. Keepapp_main.cppas the single canonical SV transport-failure authority. Prove bounded memory/hot-path overhead and feasibility at both 4000 and 4800 fps; if timestamp acquisition is not suitable for every packet, make measurement coverage/sample policy explicit instead of reporting partial observations as full-stream jitter truth.Acceptance remains open: physical hardware timestamp/independent-capture evidence has not been collected by this source audit. No timing/compliance claim or new code authority is added by this note.
P3-A1: ESP32-P4 bounded binary decoder and atomic profile activation (#…
masarray commentedon Oct 24, 2026
P2 track reconciliation 24 Oct 2026: exact M3.H source is now in main via #299, baseline
a922e9bd...; 4I+4V/4000fps 40.76s capture with 163,048 consecutive frames, no sequence loss, PTP lab metadata. Keep this issue OPEN for its broader original exit gate: 4800fps independent hardware capture, at least 60s continuous runs at both sample rates, physical scheduling jitter percentile evidence and machine-readable timing report. Public M3.H Stable supports only advertised 4kHz lab profile.masarray commentedon Oct 24, 2026
M3.H release backlog reconciliation — 2026-10-24
Release scope clarification: M3.H stable 4 kHz/4I+4V local bench build a922e9b... passed 10/10 original CI and the valid 40.76 s capture (163,048 SV; 3999.884 fps). This does not satisfy this issue's full 60 s/4800 fps/jitter evidence acceptance. Keep OPEN for remaining rate and hardware measurements. Do not transplant legacy PR #166 into the immutable M3.H firmware.
Canonical ledger: https://github.com/masarray/arstack61850/blob/main/docs/integration/M3H_MAINLINE_RELEASE_SOURCE_CLOSURE_2026-10-24.md .