Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
420 changes: 420 additions & 0 deletions docs/PLAN_NRF_HARDWARE_WATCHDOG_2026-08-01.md

Large diffs are not rendered by default.

35 changes: 27 additions & 8 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@ build_flags =
; build. If it silently stops doing so we are back on SPIM3 with no error. Check
; with: pio run -e nrf52840custom -v 2>&1 | grep -c 'SPI_32MHZ_INTERFACE=1.*SPI\.cpp'
-DSPI_32MHZ_INTERFACE=1
; Hardware watchdog timeout, seconds. 0 disables; valid range is 60..3600
; (enforced by a static_assert in src/watchdog_nrf.cpp).
;
; KNOWN GAP: 120 s is BELOW the single longest span the firmware cannot
; instrument -- a REFRESH_FULL on a 7-colour split-buffer panel sends the init
; sequence to BOTH controllers, and each of its 4 BUSY_WAIT entries can take
; 30 s, i.e. ~240 s inside one bbepRefresh() call. The per-entry-point feed in
; display_service.cpp (see odWatchdogFeed() call sites) still bounds the dog to
; that one call rather than that call plus everything preceding it, but at
; 120 s a HEALTHY refresh on that panel class will trip the watchdog mid-refresh.
; Chosen anyway on 2026-08-03 (see conversation); re-check before shipping to any
; 7-colour split-buffer panel. See docs/PLAN_NRF_HARDWARE_WATCHDOG_2026-08-01.md
; sections 3.2 and W-2 for the original 300 s derivation.
;
; The three other nRF envs inherit this via ${env:nrf52840custom.build_flags}.
-DOPENDISPLAY_NRF_WDT_S=120
platform = https://github.com/maxgerhardt/platform-nordicnrf52
framework = arduino
board_build.variants_dir = variants
Expand Down Expand Up @@ -154,7 +170,7 @@ lib_deps =
bitbank2/FastEPD@^2.2.0
build_flags =
-DTARGET_ESP32
-DOPENDISPLAY_ENABLE_WIFI ; WiFi/LAN transport: S3 + C6 + C3 (classic ESP32 excluded)
-DOPENDISPLAY_ENABLE_WIFI ; LAN transport + ROM tinfl. Set ONLY on -DBOARD_HAS_PSRAM envs (src/wifi_service.h)
#-DOPENDISPLAY_ZLIB_WINDOW_BITS=15
-DOPENDISPLAY_ZLIB_USE_HEAP_WINDOW=1
-DBOARD_HAS_PSRAM
Expand Down Expand Up @@ -184,7 +200,7 @@ lib_deps =
bitbank2/FastEPD@^2.2.0
build_flags =
-DTARGET_ESP32
-DOPENDISPLAY_ENABLE_WIFI ; WiFi/LAN transport: S3 + C6 + C3 (classic ESP32 excluded)
-DOPENDISPLAY_ENABLE_WIFI ; LAN transport + ROM tinfl. Set ONLY on -DBOARD_HAS_PSRAM envs (src/wifi_service.h)
#-DOPENDISPLAY_ZLIB_WINDOW_BITS=15
-DOPENDISPLAY_ZLIB_USE_HEAP_WINDOW=1
-DBOARD_HAS_PSRAM
Expand Down Expand Up @@ -213,7 +229,7 @@ lib_deps =
bitbank2/FastEPD@^2.2.0
build_flags =
-DTARGET_ESP32
-DOPENDISPLAY_ENABLE_WIFI ; WiFi/LAN transport: S3 + C6 + C3 (classic ESP32 excluded)
-DOPENDISPLAY_ENABLE_WIFI ; LAN transport + ROM tinfl. Set ONLY on -DBOARD_HAS_PSRAM envs (src/wifi_service.h)
#-DOPENDISPLAY_ZLIB_WINDOW_BITS=15
-DOPENDISPLAY_ZLIB_USE_HEAP_WINDOW=1
-DBOARD_HAS_PSRAM
Expand Down Expand Up @@ -242,7 +258,7 @@ platform = https://github.com/pioarduino/platform-espressif32/releases/download/
framework = arduino
build_flags =
-DTARGET_ESP32
-DOPENDISPLAY_ENABLE_WIFI ; WiFi/LAN transport: S3 + C6 + C3 (classic ESP32 excluded)
-DOPENDISPLAY_ENABLE_WIFI ; LAN transport + ROM tinfl. Set ONLY on -DBOARD_HAS_PSRAM envs (src/wifi_service.h)
-DOPENDISPLAY_ZLIB_USE_HEAP_WINDOW=1
-DBOARD_HAS_PSRAM
-DARDUINO_USB_MODE=0
Expand Down Expand Up @@ -291,7 +307,8 @@ platform = https://github.com/pioarduino/platform-espressif32/releases/download/
framework = arduino
build_flags =
-DTARGET_ESP32
-DOPENDISPLAY_ENABLE_WIFI ; WiFi/LAN transport: S3 + C6 + C3 (classic ESP32 excluded)
; -DOPENDISPLAY_ENABLE_WIFI deliberately absent: no PSRAM here (see src/wifi_service.h).
; BLE-only, and the inflate engine falls back to uzlib.
#-DOPENDISPLAY_ZLIB_WINDOW_BITS=15
-DOPENDISPLAY_ZLIB_USE_HEAP_WINDOW=1
-DARDUINO_USB_MODE=1
Expand All @@ -311,7 +328,8 @@ extra_scripts =
post:scripts/esp32c6_nimble_mempool_link.py
build_flags =
-DTARGET_ESP32
-DOPENDISPLAY_ENABLE_WIFI ; WiFi/LAN transport: S3 + C6 + C3 (classic ESP32 excluded)
; -DOPENDISPLAY_ENABLE_WIFI deliberately absent: no PSRAM here (see src/wifi_service.h).
; BLE-only, and the inflate engine falls back to uzlib.
#-DOPENDISPLAY_ZLIB_WINDOW_BITS=15
-DOPENDISPLAY_ZLIB_USE_HEAP_WINDOW=1
-DARDUINO_USB_MODE=1
Expand All @@ -331,7 +349,8 @@ platform = https://github.com/pioarduino/platform-espressif32/releases/download/
framework = arduino
build_flags =
-DTARGET_ESP32
-DOPENDISPLAY_ENABLE_WIFI ; WiFi/LAN transport: S3 + C6 + C3 (classic ESP32 excluded)
; -DOPENDISPLAY_ENABLE_WIFI deliberately absent: no PSRAM here (see src/wifi_service.h).
; BLE-only, and the inflate engine falls back to uzlib.
#-DOPENDISPLAY_ZLIB_WINDOW_BITS=15
-DOPENDISPLAY_ZLIB_USE_HEAP_WINDOW=1
-DARDUINO_USB_MODE=1
Expand All @@ -355,7 +374,7 @@ lib_deps =
bitbank2/FastEPD@^2.2.0
build_flags =
-DTARGET_ESP32
-DOPENDISPLAY_ENABLE_WIFI ; WiFi/LAN transport: S3 + C6 + C3 (classic ESP32 excluded)
-DOPENDISPLAY_ENABLE_WIFI ; LAN transport + ROM tinfl. Set ONLY on -DBOARD_HAS_PSRAM envs (src/wifi_service.h)
-DOPENDISPLAY_ZLIB_USE_HEAP_WINDOW=1
-DBOARD_HAS_PSRAM
-DARDUINO_USB_MODE=1
Expand Down
5 changes: 5 additions & 0 deletions src/boot_screen.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "boot_screen.h"
#include "watchdog.h"
#include <Arduino.h>
#include <string.h>
#include <stdlib.h>
Expand Down Expand Up @@ -510,6 +511,7 @@ static bool bootLayoutFit(uint16_t w, uint16_t h, uint16_t h_full, int blockH, i
// and stream it. planeRow scratch lives just past the 2bpp row in staticRowBuffer
// (200B + 100B for an 800px panel, well within the 680B buffer).
static void writeGray4PlaneRow(const uint8_t* row2bpp, int pitch2bpp, int planePitch, uint16_t w, int bitSel) {
odWatchdogBreadcrumb(OD_WDT_PHASE_STREAM);
uint8_t* planeRow = staticRowBuffer + pitch2bpp;
memset(planeRow, 0x00, planePitch);
for (uint16_t x = 0; x < w; x++) {
Expand Down Expand Up @@ -1031,6 +1033,7 @@ bool writeBootScreenWithQr() {
} else if (e1004Stream) {
e1004_write_stream_bytes(row + (size_t)halfPass * e1004HalfPitch, e1004HalfPitch);
} else {
odWatchdogBreadcrumb(OD_WDT_PHASE_STREAM);
bbepWriteData(&bbep, row, pitch);
}
#else
Expand All @@ -1039,6 +1042,7 @@ bool writeBootScreenWithQr() {
} else if (e1004Stream) {
e1004_write_stream_bytes(row + (size_t)halfPass * e1004HalfPitch, e1004HalfPitch);
} else {
odWatchdogBreadcrumb(OD_WDT_PHASE_STREAM);
bbepWriteData(&bbep, row, pitch);
}
#endif
Expand All @@ -1058,6 +1062,7 @@ bool writeBootScreenWithQr() {
memset(row, 0x00, pitch);
bbepSetAddrWindow(&bbep, 0, 0, w, h);
bbepStartWrite(&bbep, PLANE_1);
odWatchdogBreadcrumb(OD_WDT_PHASE_STREAM);
for (uint16_t y = 0; y < h; y++) bbepWriteData(&bbep, row, pitch);
}
}
Expand Down
Loading
Loading