Files
ESP32-S3-Touch-LCD-5B/wiki/pages/open-questions.md
T

23 KiB
Raw Permalink Blame History

type, tags, updated
type tags updated
synthesis
meta
todo
2026-09-27

Open Questions

The research frontier. Answering any of these should trigger updates across the wiki. Ordered roughly by how much they block progress.

Blocking

(Nothing is blocking as of 2026-07-17 — the CAN map is decoded end-to-end. See #8 for the one live calibration left.)

Active

  1. What is the scaling of 0x0BA D3/D4 (output shaft speed)? Identification verified; factor still open and revised 2026-07-17. The field is confirmed output shaft speed (rises monotonically 1st→6th, zero whenever the output is held). The factor is not settled: the upshift-schedule test suggested ×0.125, but a direct Launch reference (128 rpm @ raw 1192) contradicts it — that implies ~0.107 (0.125 would predict 149 rpm). One eyeballed cross-tool point isn't a calibration, so nothing is adopted yet. Closing it is now easy: the Launch reads output speed directly in rpm, so log several simultaneous (raw, Launch-rpm) pairs across a speed sweep and fit a line (slope = factor, intercept ≈ 0). Log 0x1A2 too for an independent box-identity cross-check. Still the project's only road-speed signal (no DSC on this bus). → driveline-speed-signals

  2. Was the BMW transfer case retained, and what's downstream? The 6HP26X measures its output shaft upstream of the transfer case, so raw counts → km/h depends on the path: BMW case retained (rear output ~1:1, math unaffected) / deleted and coupled straight to the Patrol driveline (also fine) / a Patrol transfer case in the path (its ratio enters the calculation and changes with high/low range, making road speed range-dependent). → nissan-patrol-swap

  3. Is a cruise-control PoC worth pursuing, and under what safety envelope? The bus architecture supports it natively (the DME arbitrates torque requests from the EGS and ACC; ST_CLCTR_V reports which regulator has control). But actuation means transmitting frames that command engine torque, with unknown checksum/alive-counter algorithms and no brake-pedal signal on this bus to build the standard cancel interlock from. Design decision, not a research question. → driveline-speed-signals

  4. What are the Patrol's final drive ratio and tyre size? Needed to turn output-shaft rpm into road speed. Swap-specific — not in any donor documentation. → nissan-patrol-swap

Design decisions (parked, not blocking)

  1. The "Diagnostics" screen (planned 2026-09-23). Active diagnostic polling — replaying the 2C live-data reads we decoded (launch-capture-2026-09-23) so values like rail pressure appear on Main CTRL without the Launch — is now technically unblocked (no session/security needed). Intended design when built: a password-protected Diagnostics screen, authorized-technician access only, manual trigger, refuses while a scan tool is connected, read-oriented services only. The same gate covers the general transmit-on-the-bus decision. This is deliberately deferred, but the capability, the byte sequences, and these guard rails are recorded so the work resumes from here, not from scratch. OTA check/install was meant to live here too (2026-09-26); decided otherwise 2026-09-27: it is on the Settings screen behind a confirm dialog (ota-updates). Whatever password this screen gets must be stored as a salted hash in NVS because the firmware is public. → obd-diagnostic-polling, dual-controller-architecture, ota-updates

Project context

  1. Exact donor model year / DDE version and EGS variant? Partly answered 2026-07-17. The gearbox is a ZF 6HP26X (user-confirmed) — the X is the xDrive output variant, which means the donor is an E60/E61, not an E65: the 7-series never took M57N + xDrive. Remaining: model year and DDE version. Cheap to close (2026-09-21): the Launch scanner's ECU-identification page (or any INPA "control unit found" string) names the variant — D60M57D0/D62M57B0 = DDE6 (EDC16), D73N57C0 = DDE7.3 (EDC17). Update 2026-09-23: generic OBD can NOT close this — mode 09 (VIN 09 02, ECU name 09 0A) is ACKed but never answered (diag-route-a-2026-09-23). Same afternoon, mostly ANSWERED via Route B: 1A 86 on 0x6F1 returned the DDE ident — VIN prefix WBANC92090 → E60 530d (unverified decode), DDE part numbers 7 799 764 / 7 799 765 / 7 793 887, date 2006-03, and the DDE speaks KWP2000 not UDS (diag-route-b-2026-09-23). Remaining sliver: look up the part numbers / NC9x model code online to pin the exact DDE variant (DDE6.1 vs 6.2, M57N vs M57N2) — a web/parts-catalogue task now, no more hardware needed. → bmw-m57n-engine, obd-diagnostic-polling
  2. Standalone harness or full donor loom? Which BMW modules were retained? Affects which modules broadcast on the swap's bus. → nissan-patrol-swap
  3. Which Patrol generation, and how is the display being mounted/powered? → nissan-patrol-swap

Hardware

  1. Operating temperature 0–65 °C (source: waveshare-wiki) — outside automotive norms at both ends (sub-zero winter cabins, sun-baked dashboards). Is the mounting location temperature-controlled enough? Any mitigation (mounting away from vents/sun, accepting reduced lifespan)?
  2. Transient protection on the 7–36 V input: the board takes vehicle 12 V directly, but ISO 7637 load-dump spikes can exceed 36 V (unverified). Consider an upstream TVS diode / automotive-rated buck. Also: ignition-switched vs constant power (the isolated digital input could sense ignition).
  3. Fault codes: the UART packet reserves a field for fault codes — DDE fault codes are read via diagnostic protocols (KWP2000/UDS over K-line or CAN), not passively broadcast. Is passive reading even possible? (unverified) — update 2026-07-17: the same barrier explains why the Launch scanner shows boost/gearbox data our dump lacks (it polls; nothing broadcasts them). A capture while the Launch is connected would record both request and reply frames, handing us the exact bytes to replay. Update 2026-09-21: the user has seen 0x612 appear on the tapped bus while the Launch is connected — that is the DDE replying (0x600 + DDE address 0x12); the requests go out on 0x6F1. Diagnostic traffic therefore reaches our tap, so the capture will contain both halves. Page written with the capture procedure and the firmware implications (polling = transmitting on the bus). Cheapest first experiment (from dwr-335d-torque-pids): one generic 01 00 supported-PID query on 0x7DF — tells whether this DDE answers EOBD on the PT-CAN and which mode-01 PIDs it has, with zero BMW-specific knowledge. Update 2026-09-23 — experiment run, answer: YES. The DDE serves mode 01 on 0x7E8 (verified), and PID 01 shows MIL off with 5 stored DTCs (diag-route-a-2026-09-23). Same afternoon: diag dtc (mode 03) read them (verified): P0101 (MAF), P0113 (IAT), P0500 (VSS), P0545 (EGT), P0030 (O2 heater) — all disconnected-sensor swap leftovers, and the first two explain the garbage MAF/IAT PID values (diag-route-b-2026-09-23). Route B addressing also verified live (0x6F1 [12] → 0x612). What remains of this question: BMW-specific (non-P0xxx) codes and the live-data identifiers. Update 2026-09-23 — Launch capture done (launch-capture-2026-09-23): live data comes via service 2C (not 22 D1xx, which don't exist here); rail pressure fully decoded and verified (2C 10 00 DF → 6C 10 HHLL, bar = HHLL × 0.03). The recipe now generalises to any Launch-visible value (boost, MAF, injection… one capture session each). Reading them without the Launch needs replaying the session/define handshake — a transmit-on-the-bus design decision, deferred. → obd-diagnostic-polling

Answered

  • Was the engine actually running during the 2026-07-15 capture? → Yes — 0x1D0 ST_ENGINE_RUN = 2 ("running") in 397/397 frames (verified, 2026-07-17). The coolant trace is genuine warm-up data; the cold-start capture that was blocking #1 is no longer needed. → e65-reverse-engineering-repo

  • Gearbox oil temp offset: 0 or +40? → Neither — raw − 40 (verified two ways, 2026-07-17): the source's worked example, plus our own gearbox-at-31 °C vs coolant-at-37 °C warm-up cross-check. → e65-reverse-engineering-repo

  • Battery voltage layout: 12-bit LE ×0.015 or 24-bit BE ×0.001? → 12-bit LE × 0.015 (source: E65 repo worked example 0x3D9→14.775 V, 2026-07-17).

  • What is the actual engaged gear number, and does it need a drive capture? → 0x1D2 D1, gear = (D1>>4)−4. No drive capture needed — a per-detent capture sufficed. (verified, 2026-07-17) → gear-box-can-revealings

  • What is the manual up-shift (+) value on 0x1D2 D4? → The question was malformed. D4 is a persistent mode (0xF0 auto / 0xF1 Sport / 0xF2 Manual), not a shift-event field; + and − have no distinct codes. (verified, 2026-07-17)

  • Is engaged reverse observable? → Yes, but not on 0x1D2 (D1 stays 0x0F in R, moving or stationary). Use 0x0BA ST_GR_GRB = 2. For physical proof of engagement, use turbine speed. (verified, 2026-07-17) → driveline-speed-signals

  • Are 0x0BA ST_GR_GRB values 6–A really 2nd–6th? → Yes, all observed directly in the drive capture. 0x0BA D0's low nibble is a complete gear source on its own (P/R/N + 1st–6th, reverse included). (verified, 2026-07-17) → can-capture-2026-07-17-drive

  • Is boost passively broadcast? → No. 0x1D0 AIP_ENG is barometric (caps at 1108 hPa vs ~2500 needed). Diagnostic polling only. (2026-07-17)

  • Which donor vehicle? → E60/E65 (2003+) (verified — user, 2026-07-15) → bmw-m57n-engine

  • Is the EGS on the bus? → Yes — BMW auto with EGS wired in; gearbox temp and gear position have a real source. (verified — user, 2026-07-15)

  • Is the target a Nissan Patrol? → Yes. (verified — user, 2026-07-15) → nissan-patrol-swap

  • CAN transceiver? → Onboard TJA1051T/3/1J on a terminal block; leave the 120 Ω termination switch OFF when tapping the vehicle bus. (source: waveshare-wiki, 2026-07-15) → esp32-s3-touch-lcd-5b

  • Does passive-ish listening actually work on this bus? → Yes — first live capture pulled 15 IDs cleanly at ~486 frame/s (verified, 2026-07-15). Note the firmware runs TWAI_MODE_NORMAL (ACKs), not LISTEN_ONLY. → can-capture-2026-07-15

  • How to ground the board to the vehicle? → TJA1051 is non-isolated; share ground with the vehicle (power from 12 V, or ground-wire + laptop on battery to avoid a ground loop). (verified, 2026-07-15) → esp32-s3-touch-lcd-5b

  • 12 V → 5 V power conversion? → Not needed: board has a 7–36 V DC wide input. Residual transient concern moved to #6. (source: waveshare-wiki, 2026-07-15)

Sourcing wishlist

  • Waveshare product page ✅ ingested → esp32-s3-touch-lcd-5b-waveshare-wiki
  • Waveshare schematic PDF ✅ re-downloaded into raw/ 2026-09-26 → esp32-s3-touch-lcd-5-schematic (VOUT/H8 selection, 5 V rail budget, SD pins)
  • A community DBC / CAN-ID list for the donor platform ✅ ingested → e65-reverse-engineering-repo
  • A real candump log from the engine running ✅ → can-capture-2026-07-15 (engine confirmed running, 2026-07-17)
  • 6HP26.pdf — sitting in the E65 repo's docs/. The ZF 6HP26 manual, very likely our exact gearbox: gear ratios would let us convert output-shaft rpm → road speed and self-check the D3/D4 scaling. → driveline-speed-signals
  • can_message_list.txt (same repo) — full ID → name → sending-module map, 0x00–0xFFF. Not yet mined; useful if the project ever wants non-powertrain data
  • A capture taken while the Launch scanner is polling — would reveal the request/response byte sequences for boost, gearbox temp and DTCs. Step-by-step procedure now on obd-diagnostic-polling; also read the Launch's ECU-identification page during the same session (closes #2)
  • Web search on DDE7 M57 PIDs ✅ clipped → google-ai-dde7m57-pids — uncited AI summary; identifiers (unverified), addressing claim contradicted
  • A worked generic-PID set for an M57 diesel ✅ ingested → dwr-335d-torque-pids (2009 335d, DDE7.3; J1979 mode-01 scalings gauge-checked by the author)
  • DWR's Testo parameter list (e90post "Testo" thread, post 175, German→English names of the DDE's non-standard values) — the pointer for Route B identifiers if our own Launch capture is not enough
  1. Internal RAM is nearly exhausted (found 2026-09-26) — largely relieved 2026-09-27: LVGL's 48 KB pool moved to PSRAM (512 KB) → internal free 16 → 69 KB, largest block 7.6 → 31.7 KB, enough for bounce buffers to be attempted. Original finding: With display + Wi-Fi up: 15.9 KB internal free, largest block 7.6 KB (PSRAM 7.1 MB free). OTA works around it (ota-updates), but anything else that needs an internal allocation (another task, a TLS client, a bigger Wi-Fi burst) can fail. Biggest known consumer: the LVGL 60-line DMA draw buffer (~120 KB). Options: shrink it to ~30–40 lines, or measure what else lives in internal RAM first (heap_caps_print_heap_info). Not urgent, but it limits every future feature. Same project as the display flicker/lag (2026-09-26): flash writes flicker the PSRAM-fed RGB panel (no bounce buffer) and full-screen transitions stutter. Espressif's cure is bounce buffers + CONFIG_SPIRAM_XIP_FROM_PSRAM (needs pioarduino custom_sdkconfig), and bounce buffers need internal RAM — so free RAM, add bounce buffers, and measure real render FPS (LVGL perf monitor; the Debug "FPS" counts loop() passes, not frames) in one bench session. Quick mitigations shipped in v0.1.2 (instant screen switches, deferred NVS saves, dark screen during OTA).

    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. 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 session logged 2026-09-27 → perf-baseline-2026-09-27: Driveline redraws ~10×/s with nothing changing (39 kpx, 30 ms, a third of core 1 — an unconditional lv_label_set_text every 100 ms (repo)); screen changes are single 140–330 ms frames (= the swipe lag; not a bounce-buffer matter); the Simulation tab is the heaviest normal load (2 Mpx/s, 26 % of the time writing PSRAM, LVGL idle 9 %); a flash write is invisible to the LVGL counters, so the monitor needs a panel vsync/refresh counter to see flicker and dots directly; the monitor is blind during OTA (ticks from the blocked loop()). Heap flat throughout (66–67 KB internal, 31.7 KB largest, 6.6 MB PSRAM). Plan amended: 1b = stop the Driveline redraw + add vsync counter + timer-driven PERF, re-baseline; step 2 judged on the Simulation tab and during a scan, by the refresh counter. Step 1b done 2026-09-27 (verified, bench): Driveline tick() now writes labels/chips only on change → idle Driveline 0 fps, 0 ms/s PSRAM copies, LVGL idle 96 %, core 1 idle 96 % (was 9.7 fps / 52 ms/s / 68 % / 66 %). perf gained the panel counters: ~24 vsync/s, longest gap 41.5 ms when healthy — a DMA restart must show as a gap ≥ 2 frames (≈ 83 ms). Reporting runs from an esp_timer, so OTA is no longer a blind spot. Second session 2026-09-27 → perf-dots-and-ota-2026-09-27: (a) with dots on screen and everything idle the panel refreshed perfectly (24/s, 41.5 ms) — dots are sub-frame DMA data glitches, invisible to the vsync counter, judged by eye only; bounce buffers are the designed fix; (b) during ota install the panel drops to 4–8 refreshes/s with 290–747 ms gaps — flash writes blank it ~75 % of the time; no progress bar is possible before step 3; target 24/s + 41.5 ms during an install. Tuning save and ota check lost no frame. Correction the same evening: the panel library already runs 10-line bounce buffers and a 21 MHz clock (the platformio.ini flags saying otherwise were dead names) — so the dots are late bounce refills re-sending the previous 10-line chunk (the photo shows text pixels echoed below each line), and step 2 as written is moot. Step 3 (CONFIG_SPIRAM_XIP_FROM_PSRAM + CONFIG_LCD_RGB_ISR_IRAM_SAFE, pioarduino custom_sdkconfig, branch display-xip) now targets both the dots and the OTA blanking. Fallbacks if dots remain: lower pixel clock (18 MHz), larger bounce buffers, Wi-Fi/LWIP buffers back to internal RAM (CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=n, costs internal RAM). Step 3 built and measured 2026-09-27 17:46 → perf-xip-ota-2026-09-27: during a full ota install the panel held 24–25 refreshes/s with a 41.5 ms gap (stock core: 4–8/s, 290–747 ms). The flash-write blanking is fixed (verified); a progress bar during updates is now possible (step 4). PSRAM free 6.6 → 4.9 MB (code resident there); no render slow-down seen in the one full-redraw sample. Dots on the XIP build still to be judged by eye (Wi-Fi up, idle screen). Step 4 done 2026-09-27: the OTA notice keeps the screen on with a progress bar and "Do not switch off the ignition"; second forced install under perf: 24–25 frames/s, 41.5 ms gap throughout, bar redrawing 2–3×/s; user: "the progress bar appeared and no flickering or other issues" (verified). Merged to main and tagged v0.1.7 (2026-09-27, user decision) after the user exercised the XIP build (Wi-Fi scan, update check and install) with no flicker or other issues reported. Whether the dots are fully gone in longer use stays open — report any sighting on v0.1.7 and the fallbacks above apply. First CI run with the core rebuild = the v0.1.7 tag build; if it fails, the release is missing until the workflow is fixed.
    2. Step A - bounce buffers only (void — already on, 10 lines, via the board header; 2026-09-27) (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.

    Not affected by any of this: CAN, the RS485 wire and ESP-NOW - small, bursty, with their own hardware FIFOs and internal-RAM queues; none streams from PSRAM on a deadline (discussed 2026-09-27). The only reverse risk is the CAN RX FIFO overflowing during a flash write (ISR delayed); negligible for rebroadcast values and irrelevant while parked. A dropped-frame counter (TWAI rx_missed_count / rx_overrun_count) was offered and deferred by the user; it becomes worth adding if a value ever glitches while driving, or before diagnostic polling (multi-frame replies must arrive whole).

  2. Wi-Fi UX (found 2026-09-26) — RESOLVED 2026-09-27 (v0.1.5): Settings rebuilt as a hand-coded screen (the SquareLine one is deleted) with Wi-Fi / Updates / System sections: connection status with failure reasons, networks nearby, full-screen password page, one remembered network joined at boot, scans only on request. User: "Wow, I like it" / "All good". Remaining housekeeping below still applies. Original finding: The Settings Wi-Fi screen had never worked (switch shipped disabled) and, now usable, is "a disaster UX" (user): SquareLine-generated, runtime SSID buttons + floating keyboard + loading overlay, no on-screen confirmation of a successful join. Also: A forgets the network on every reboot (each boot needs wifi join). To do: redesign as a hand-coded screen (like Driveline/Tuning, safe from SquareLine re-exports), show connection state, remember the network in NVS and auto-join; consider housing it on the Diagnostics screen (#12) next to the OTA controls, since Wi-Fi now mainly serves updates. Fixed 2026-09-27: the SSID buttons' pointers dangled after SquareLine deleted the Settings screen (use-after-free on the next scan), and scans ran every 10 s on every screen even when connected (flickering dots) — see esp32-s3-touch-lcd-5b. Housekeeping: delete the v0.1.0 release on Gitea — installing it would strand the board without working OTA (USB only). → ota-updates