Add perf console (render fps, flush cost, CPU idle, heap) for the display work; record idle baseline
Firmware / build (push) Successful in 4m8s
Firmware / build (push) Successful in 4m8s
This commit is contained in:
@@ -154,3 +154,7 @@ User asked whether VOUT becomes 5 V by "unsoldering the resistor". Re-fetched `E
|
||||
|
||||
I argued for the cheap half only (baseline, 40-line draw buffer, time-boxed bounce buffers) and deferring XIP-from-PSRAM as cosmetic. User corrected two premises: the dots still appear occasionally on v0.1.6 (the "gone" claim on [[esp32-s3-touch-lcd-5b]] was too strong — now qualified), and a dark screen during OTA is a safety/UX defect (no feedback → driver may turn the ignition off mid-update). Decision (user): fix everything, all steps through XIP, bench time is no constraint; add an on-screen progress bar + "do not switch off" during updates. Recorded on [[open-questions]] #13. Also explained in plain terms why the coolant duty law still needs re-deriving through the FET stage ([[patrol-instrument-cluster]]); that remains the higher-priority car-facing item.
|
||||
|
||||
## [2026-09-27] build | `perf` console: the measuring stick for open question 13
|
||||
|
||||
Step 1 of the display plan. New `src/modules/perf_monitor.cpp`: LVGL `monitor_cb` (frames, ms/frame, px), a timer around `drawBitmap()` in the port's flush callback (ms per second spent writing the PSRAM framebuffer), `lv_timer_get_idle()`, FreeRTOS run-time stats for per-core idle (enabled in the Arduino core's sdkconfig), heap figures. `perf` / `perf on [sec]` / `perf off`; `PERF,` CSV lines sit next to `CANRAW` in a session log. Built and flashed COM14 (the 5B enumerates as COM14 today; the 1.3 as COM13). Idle baseline recorded on [[open-questions]] #13. Next: the provoke session (Wi-Fi scan, tuning save, OTA) with `perf on 1` logging, then bounce buffers.
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ The research frontier. Answering any of these should trigger updates across the
|
||||
**Decision 2026-09-27 (user): this is a must-fix, all steps through XIP, bench time is no constraint.** Two corrections to the record: (a) the flickering dots **still appear occasionally** on v0.1.6 — the scan policy reduced the trigger, it did not remove the weakness; (b) the dark screen during OTA is a **safety/UX defect**, not a mitigation: with no feedback a driver may switch the ignition off mid-update. Requirement: the screen stays on during an update with a visible progress bar and a "do not switch off" message — which needs Step B (flash writes must stop blanking the panel), plus an OTA progress callback on the Updates page. (The OTA design already survives a power cut — the new image is only confirmed after 30 s, else it rolls back — so the risk is a wasted update and a confused user, not a bricked board.)
|
||||
|
||||
**Plan agreed 2026-09-27 (next display session, bench + USB, `dev` builds only until verified):**
|
||||
1. **Baseline first**: Settings → System → Performance overlay (LVGL's perf monitor = real render FPS + CPU; never measured before). Provoke each symptom on purpose: a Wi-Fi scan (dots), a Tuning edit that gets saved (flash write), an update (flash writes). Without numbers there is no telling whether a change helped.
|
||||
1. **Baseline first**: Settings → System → Performance overlay (LVGL's perf monitor = real render FPS + CPU; never measured before). Provoke each symptom on purpose: a Wi-Fi scan (dots), a Tuning edit that gets saved (flash write), an update (flash writes). Without numbers there is no telling whether a change helped. **Tooling landed 2026-09-27 `(repo)`**: the `perf` console command (`perf on 1` streams a `PERF,` CSV line per second: fps, ms/frame, flush ms/s, LVGL idle, core idle, heap). **Idle baseline, Driveline screen, bench/USB, v0.1.6+perf**: 9.7 fps rendered (= the screen's own update rate), 30 ms per frame avg (122 ms worst in the first window), ~40 kpx/frame, 52 ms/s copying into the PSRAM framebuffer, LVGL idle 68 %, core 0 idle 94 %, core 1 idle 66 %, internal 66.9 KB free / 31.7 KB largest, PSRAM 6.6 MB free. Provoke runs (scan / tuning save / OTA) still to be logged.
|
||||
2. **Step A - bounce buffers only** (`ESP_PANEL_LCD_RGB_BOUNCE_BUF_SIZE`, today 0; start at 10 lines = 1024x10 px, ~20 KB each, two buffers, internal DMA-capable RAM). The panel then reads from internal RAM that the CPU refills from PSRAM, so it tolerates short PSRAM stalls. **Expected to cure the Wi-Fi-traffic dots; will NOT cure flash-write flicker**: while flash is written the cache is disabled, so the refill has nothing to read from either. RAM: 67 KB internal free but the largest block is ~32 KB, so two 20 KB buffers may not fit - if not, shrink the LVGL draw buffer 60 -> 40 lines (frees ~40 KB) and check render speed. The refill costs CPU (measure).
|
||||
3. **Step B - `CONFIG_SPIRAM_XIP_FROM_PSRAM` (+ `CONFIG_SPIRAM_RODATA`)** via pioarduino `custom_sdkconfig`: code and constants run from PSRAM, so flash writes no longer block PSRAM. **Cures flash-write flicker** (screen could stay on during OTA with a progress bar instead of going dark). Cost/risk: `custom_sdkconfig` rebuilds the Arduino core from source (much slower builds, locally and in CI), and may not work cleanly with this platform version - do it on a branch, release only once it works.
|
||||
4. **Measure again after each step** (FPS, CPU, which symptoms still reproduce) and record the numbers here and on [[esp32-s3-touch-lcd-5b]].
|
||||
|
||||
Reference in New Issue
Block a user