Repository navigation
Add ESP32-P4-ETH SMV injector P0/P1 and P2 50 Hz realtime foundation - #19
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5dd4ea3afc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| In Wireshark use: | ||
|
|
||
| ```text | ||
| eth.type == 0x88ba |
There was a problem hiding this comment.
Filter on the VLAN-encapsulated EtherType
Because make_smoke_frame() adds an 802.1Q tag, a packet-capture dissector exposes the outer Ethernet type as 0x8100 and the encapsulated SV type as vlan.etype; therefore filtering only on the outer field can hide the emitted SV frames. Use vlan.etype == 0x88ba, or include both fields if untagged frames must also be shown.
|
CI update: the ESP32-P4 target now builds successfully on the pinned ESP-IDF version after isolating the Ethernet default-config macros in a C board adapter. Portable C++ CI is also green on the supported compiler matrix, and sanitizer/fuzz evidence jobs pass. Software P0/P1 is therefore build-clean. I am deliberately leaving this PR open until the physical board acceptance is captured: flash the ESP32-P4 Ethernet target on an isolated bench/direct capture NIC, verify link-up and |
|
Hardware log review found a real P2 scheduler defect: the 250 us busy-wait publisher monopolized CPU1, starving IDLE1 and tripping the Task Watchdog every ~5 s. The board was otherwise reaching ~4000 fps with zero TX API failures, but each watchdog episode introduced burst missed slots / rate dips, so that implementation is not acceptable timing evidence. Fixed in commits db44bf9 + 8ecbed0: P2 cadence now comes from a 1 MHz ESP-IDF GPTimer periodic 250 us alarm. The ISR only gives a FreeRTOS task notification; the CPU1 publisher blocks between alarms, so IDLE1 can run/feed TWDT. Accumulated notifications are counted as missed sample slots, preserving truthful counter/timing telemetry. The hot path remains prebuilt-frame patch + All three CI gates are green at head 8ecbed0, including the ESP32-P4 firmware build. Next hardware acceptance: flash this head, confirm no Task WDT messages over >=60 s, ~4000 fps, zero TX failures, then inspect reconstructed waveform and capture timing with an independent analyzer/capture path. |
271e719 to
41379d9
Compare
Summary
Bring ARStack61850 Sampled Values onto real ESP32-P4 Ethernet hardware and advance the proven P0/P1 path into the P2 50 Hz realtime publisher foundation.
Hardware evidence proven
0x88BAframes as IEC 61850 Sampled Values.SCL-aligned canonical stream
The standards-facing stream is aligned to
01_SV_Stream_4I+4V_(9-2LE).scdstream #1:01:0C:CD:04:00:010x4000svID=MU01_SV1confRev=1Ia, Ib, Ic, In, Ua, Ub, Uc, Un, eachINT32 instMag.i + UINT32 QualitydataSet=falsesmpRate/smpModomitted from the canonical ASDU because the supplied SCL hassampleRate=falsesmpSynch=0remains truthful until PTP/1PPS lock is implemented and measuredLab-only diagnostic stream
The tested host capture path reliably exposes broadcast traffic but does not reliably expose the canonical multicast/VLAN stream. A separate diagnostic stream is therefore available:
0x4F01svID=AR_DIAG_SV1smpRate=4000,smpMod=SmpPerSecsmpCntThe separate identity prevents raw analyzers from merging canonical and mirror traffic and avoids false sequence alarms caused by applying a 65536-counter assumption to a 4000-wrap canonical stream. The diagnostic stream is not an IEC 61850 process-bus compliance target.
P2 50 Hz realtime foundation
smpCnt, 4-byteconfRev, and 64-byteseqData.Ia, Ib, Ic, In, Ua, Ub, Uc, Un.Standards-first next architecture
The next stage is intentionally not more hard-coded relay-specific patches. The embedded target documents a standards-first architecture that keeps wire facts, configured expectations, profile claims, and PTP/synchronization evidence distinct.
Planned direction in #24:
SvPublisherProfilefrom SCL on the host;smpSynchfrom measured lock state.See
NORTH_STAR.md,PROJECT_HANDOFF.md, andembedded/esp32p4_smv_injector/ARCHITECTURE.md.Public-repository naming policy
Project-owned public documentation is vendor-neutral. Commercial competitor/product names, comparison tables, logos, screenshots, and marketing references are intentionally excluded. Standards and technical platform/dependency identifiers required to build or reproduce the project are allowed.
Important boundary
This is not yet a final strict 9-2LE/IEC 61869-9 compliance claim. Remaining acceptance includes sustained 4000 fps hardware capture, hardware TX timestamp evidence, canonical multicast/VLAN capture on a trusted path, 60 Hz / 4800 fps, PTP/1PPS synchronization, SCL-driven profile deployment, and independent relay/tool interoperability.
Use only on an isolated lab process-bus bench or direct capture/TAP connection; do not connect this development image to an operational substation process bus.
Tracks deterministic timing evidence in #21 and standards-first SCL/profile/PTP work in #24.