diff --git a/csv_preprocessor.py b/csv_preprocessor.py index 4875d1f..d2aee3f 100644 --- a/csv_preprocessor.py +++ b/csv_preprocessor.py @@ -678,11 +678,12 @@ class LPMetrics: if self.flicker_suspect: if (self.hs_amplitude_mv is not None and self.hs_amplitude_mv < HS_BURST_AMPLITUDE_MIN_MV - and (self.lp_low_duration_ns is None - or self.lp_low_duration_ns >= FLICKER_LP_LOW_MAX_NS)): + and self.lp11_to_hs_ns is not None + and self.lp11_to_hs_ns >= LP_LOW_DUR_MIN_NS): lines.append( f" *** FLICKER SUSPECT: HS burst absent " - f"(amplitude {self.hs_amplitude_mv:.0f} mV < {HS_BURST_AMPLITUDE_MIN_MV:.0f} mV) ***" + f"(amplitude {self.hs_amplitude_mv:.0f} mV < {HS_BURST_AMPLITUDE_MIN_MV:.0f} mV, " + f"lp11_to_hs={self.lp11_to_hs_ns:.0f} ns) ***" ) else: lines.append( @@ -851,12 +852,17 @@ def analyze_lp_file(path: Path) -> "LPMetrics": # check alone produces a false negative. # # Only flag DAT lane (CLK is continuous HS — LP states not expected). - # NOTE: lp11_to_hs_ns is NOT used here — on this hardware a consistent noise spike - # at LP-11 exit causes the rolling-std gate to fire at ~3 ns for every capture, - # making it indistinguishable from a genuine flicker (2.8 ns confirmed flicker). + # Guard: require lp11_to_hs_ns >= LP_LOW_DUR_MIN_NS to rule out the consistent + # ~3 ns noise spike at LP-11 exit. On good captures the rolling-std gate fires + # at ~3 ns (hardware artifact); on confirmed flicker it fires at ~347 ns (real + # LP-low completes, then HS never starts → bridge returns to LP-11). + # Without this guard, DC-like HS data (uniform display content) produces low + # amplitude on otherwise good captures and causes false positives. hs_burst_absent = ( hs_amplitude_mv is not None and hs_amplitude_mv < HS_BURST_AMPLITUDE_MIN_MV + and lp11_to_hs_ns is not None + and lp11_to_hs_ns >= LP_LOW_DUR_MIN_NS ) flicker_suspect = ( channel == "dat" diff --git a/mipi_test_interactive.py b/mipi_test_interactive.py index 198217c..a1106c5 100644 --- a/mipi_test_interactive.py +++ b/mipi_test_interactive.py @@ -750,9 +750,9 @@ def analyze_lp_and_ask_claude( _append_flicker_log(ts, iteration, m) if (m.hs_amplitude_mv is not None and m.hs_amplitude_mv < HS_BURST_AMPLITUDE_MIN_MV - and (m.lp_low_duration_ns is None - or m.lp_low_duration_ns >= FLICKER_LP_LOW_MAX_NS)): - reason = f"HS burst absent ({m.hs_amplitude_mv} mV)" + and m.lp11_to_hs_ns is not None + and m.lp11_to_hs_ns >= FLICKER_LP_LOW_MAX_NS): + reason = f"HS burst absent ({m.hs_amplitude_mv:.0f} mV, lp11_to_hs={m.lp11_to_hs_ns:.0f} ns)" else: reason = f"lp_low={m.lp_low_duration_ns} ns" print(f"\n *** FLICKER SUSPECT: capture {iteration:04d} " diff --git a/reports/20260416_112708_interactive.html b/reports/20260416_112708_interactive.html new file mode 100644 index 0000000..7303a62 --- /dev/null +++ b/reports/20260416_112708_interactive.html @@ -0,0 +1,130 @@ + + +
+ ++ Pixel clock: 72.0 MHz | + Bit rate: 432.0 Mbit/s per lane | + Byte clock: 54.000 MHz + (18.519 ns/byte) | + UI: 2.315 ns +
+ +| Field | Spec (ns) | Rnd Best | Rnd Up | +Extra | Final | Actual (ns) | Status | +
|---|---|---|---|---|---|---|---|
lpx | ≥ 50.0 | 3 | 3 | +0 | 3 | 55.56 | ✓ |
hs_prepare | 49.3 – 98.9 | 3 | 3 | +0 | 3 | 55.56 | ✓ |
hs_zero | ≥ 112.6 | 6 | 7 | +0 | 7 | 129.63 | ✓ |
hs_trail | ≥ 69.3 | 4 | 4 | +0 | 4 | 74.07 | ✓ |
hs_exit | ≥ 100.0 | 5 | 6 | +0 | 6 | 111.11 | ✓ |
clk_prepare | 38.0 – 95.0 | 2 | 3 | +0 | 3 | 55.56 | ✓ |
clk_zero | ≥ 244.4 | 13 | 14 | +0 | 14 | 259.26 | ✓ |
clk_post | ≥ 180.4 | 10 | 10 | +0 | 10 | 185.19 | ✓ |
clk_trail | ≥ 60.0 | 3 | 4 | +0 | 4 | 74.07 | ✓ |
✓ All D-PHY v1.1 Table 14 constraints satisfied.
+ +| Register | Address | Value | Field breakdown |
|---|---|---|---|
| PHY_TIMING | 0xb4 |
+ 0x00000306 |
+ lpx=3 hs_exit=6 | +
| PHY_TIMING1 | 0xb8 |
+ 0x030e0a04 |
+ clk_prepare=3 clk_zero=14 + clk_post=10 clk_trail=4 | +
| PHY_TIMING2 | 0xbc |
+ 0x00030704 |
+ hs_prepare=3 hs_zero=7 + hs_trail=4 | +
# D-PHY PHY timing registers (pixel clock 72.0 MHz, 432.0 Mbit/s, byte clock 54.000 MHz)
+#
+# PHY_TIMING (0xb4) = 0x00000306 lpx=3 hs_exit=6
+# PHY_TIMING1 (0xb8) = 0x030e0a04 clk_prepare=3 clk_zero=14 clk_post=10 clk_trail=4
+# PHY_TIMING2 (0xbc) = 0x00030704 hs_prepare=3 hs_zero=7 hs_trail=4
+
+# Enable Round-Up rounding (dsi-tweak bit 2)
+setenv flb_dtovar "${flb_dtovar} dsi-tweak=4"
+
+saveenv
+boot
+
+| Capture | Timestamp | Channel | +LP-low plateau | LP exit→HS | LP-11 voltage | +Claude: flicker? | Outcome | +
|---|---|---|---|---|---|---|---|
| 0001 | 20260416_112353 | dat | 342.7 ns | 2.9 ns | 1.017 V | YES | ✓ FALSE ALARM |
| 0002 | 20260416_112431 | dat | 342.6 ns | 3.7 ns | 1.016 V | YES | ✓ FALSE ALARM |
| 0004 | 20260416_112531 | dat | 342.6 ns | 3.8 ns | 1.016 V | YES | ✓ FALSE ALARM |
| 0006 | 20260416_112630 | dat | 108.0 ns | 3.3 ns | 1.017 V | YES | ✓ FALSE ALARM |
YES + +Although the LP-low plateau itself is 343 ns (well above the 50 ns minimum), the critical failure here is the **LP exit → HS transition of only 3 ns**, far below the 50 ns spec minimum, meaning the LP-01/LP-00 preamble states were essentially skipped or too brief for the SN65DSI83 to reliably sample the SoT sequence. Additionally, the **HS amplitude of only 20 mV** is drastically below the normal 105–122 mV range and falls under the 50 mV "absent" threshold, indicating the bridge almost certainly did not detect a valid HS data burst even if it had latched SoT. Together, the absent LP-to-HS preamble and effectively missing HS signaling mean the bridge would fail to decode this frame, producing a visible flicker event.
YES + +The LP-low plateau at 343 ns is well above the 50 ns SN65DSI83 detection threshold, so the SoT preamble timing itself is not the problem here. However, the HS amplitude of only 24 mV (single-ended) is far below both the normal operating range (105–122 mV) and the 50 mV minimum detection threshold, meaning the bridge almost certainly cannot resolve valid differential HS data from this burst. Additionally, the LP exit-to-HS transition of only 4 ns (spec ≥ 50 ns) indicates the LP-01/LP-00 states were too brief for reliable SoT detection by the bridge. The combination of an effectively absent HS burst and a non-compliant LP exit duration makes this a genuine flicker event — the SN65DSI83 likely failed to lock onto the HS data, resulting in a dropped or corrupted video line/frame.
YES + +Although the LP-low plateau itself is 343 ns (well above the 50 ns minimum), the critical failure here is the HS amplitude of only 17 mV, far below the 50 mV minimum detection threshold and the normal 105–122 mV range — effectively meaning the SN65DSI83 sees no valid HS data burst at all. Additionally, the LP-exit-to-HS transition time of only 4 ns (spec ≥ 50 ns) indicates the LP-01/LP-00 states were too brief for the bridge to properly recognize the SoT preamble. Together, these two failures — an undetectable HS burst and a sub-spec LP exit duration — mean the bridge almost certainly missed this transmission, constituting a genuine flicker event.
YES + +Although the LP-low plateau itself measures 108 ns (above the 50 ns minimum), the critical failure here is the **LP exit → HS transition of only 3.3 ns**, far below the 50 ns spec minimum, meaning the LP-01/LP-00 states were essentially skipped or too brief for the SN65DSI83 to reliably detect the SoT preamble. Additionally, the **HS amplitude of 28 mV** is well below the 50 mV threshold and far below the normal 105–122 mV range, indicating the bridge almost certainly did not lock onto the HS data burst — effectively an absent HS transmission from the receiver's perspective. These two compounding failures — a near-instantaneous LP-to-HS transition and a sub-threshold HS amplitude — make it virtually certain the SN65DSI83 missed this SoT entirely, producing a visible flicker event.+ + + diff --git a/reports/flicker_log.csv b/reports/flicker_log.csv index b659ba9..a52abfa 100644 --- a/reports/flicker_log.csv +++ b/reports/flicker_log.csv @@ -96,3 +96,7 @@ logged_at,capture_ts,capture_num,channel,lp_low_duration_ns,lp11_to_hs_ns,lp11_v 2026-04-16 10:25:01,20260416_102440,0170,dat,0.3,0.8,1.015 2026-04-16 10:27:34,20260416_102713,0176,dat,0.9,0.1,1.016 2026-04-16 11:12:28,20260416_111206,0065,dat,26.7,4.0,1.016 +2026-04-16 11:24:15,20260416_112353,0001,dat,342.7,2.9,1.017 +2026-04-16 11:24:53,20260416_112431,0002,dat,342.6,3.7,1.016 +2026-04-16 11:25:52,20260416_112531,0004,dat,342.6,3.8,1.016 +2026-04-16 11:26:51,20260416_112630,0006,dat,108.0,3.3,1.017 diff --git a/reports/interactive_log.csv b/reports/interactive_log.csv index a01e8f5..717781b 100644 --- a/reports/interactive_log.csv +++ b/reports/interactive_log.csv @@ -26,3 +26,7 @@ logged_at,capture_ts,capture_num,claude_said_flicker,user_confirmed,lp_low_ns,re 2026-04-16 10:25:18,20260416_102440,0170,YES,NO,0.3,YES The LP-low plateau measured at 0.3 ns is effectively absent and falls catastrophically short of the SN65DSI83's required ≥ 50 ns minimum for SoT 2026-04-16 10:27:54,20260416_102713,0176,YES,NO,0.9,YES The LP-low plateau measured at only 0.9 ns is drastically below the SN65DSI83's required ≥ 50 ns minimum for SoT detection — it is essentially ab 2026-04-16 11:12:48,20260416_111206,0065,YES,NO,26.7,"YES The LP-low plateau of 26.7 ns is barely half the SN65DSI83's required ≥ 50 ns minimum, and the LP exit-to-HS transition of only 4 ns is drastical" +2026-04-16 11:24:30,20260416_112353,0001,YES,NO,342.7,"YES Although the LP-low plateau itself is 343 ns (well above the 50 ns minimum), the critical failure here is the **LP exit → HS transition of only 3" +2026-04-16 11:25:07,20260416_112431,0002,YES,NO,342.6,"YES The LP-low plateau at 343 ns is well above the 50 ns SN65DSI83 detection threshold, so the SoT preamble timing itself is not the problem here. Ho" +2026-04-16 11:26:06,20260416_112531,0004,YES,NO,342.6,"YES Although the LP-low plateau itself is 343 ns (well above the 50 ns minimum), the critical failure here is the HS amplitude of only 17 mV, far bel" +2026-04-16 11:27:06,20260416_112630,0006,YES,NO,108.0,"YES Although the LP-low plateau itself measures 108 ns (above the 50 ns minimum), the critical failure here is the **LP exit → HS transition of only "