## Summary
Fixes three user-reported M1 defects (root causes pre-diagnosed):
1. **RTC permanently invalid** (`-` on screen, `"utc":""` in JSONL, 228x
`ESP_ERR_INVALID_CRC`):
nothing ever wrote the PCF85063, so after power loss its OS (oscillator
stopped) bit stays set.
- `board_service::set_rtc_time(int64_t)`: gmtime_r -> BCD -> multi-byte
I2C write of registers
0x04-0x0A with seconds bit7=0 (clears OS), then re-read confirms; I2C
access serialized
against `read_rtc` with a FreeRTOS mutex (console/SNTP context safe).
- `time_sync` service: on Wi-Fi CONNECTED starts `esp_netif_sntp`
(ntp.aliyun.com +
pool.ntp.org, `CONFIG_LWIP_SNTP_MAX_SERVERS=2`), and once `time()`
passes 2020-01-01 writes
the RTC once per sync (`rtc synced from sntp`).
- Console: `rtc status` (valid/unix/utc/OS bit), `rtc raw` (0x00-0x0A
hex + decode),
`rtc set YYYY-MM-DD HH:MM:SS` (strptime, UTC, range + calendar
round-trip validation).
2. **KEY feels slow**: display rendering was throttled to 10 s.
`display_service::run` now keeps
the 10 s full-render heartbeat (with memory refresh) but adds a 500 ms
fast path that
re-renders as soon as a signature over volatile fields (key counters,
key_pressed, wifi/storage
state, tf_logging_ok, ap_active, ssid_configured, rtc valid+minute)
changes. KEY counter now
appears within ~0.5-1 s.
3. **Which button?**: README now documents that only KEY (GPIO18) is
monitored; RST reboots and
BOOT (GPIO0) does nothing, plus the `rtc` commands, SNTP behavior, and
the CR1220 coin-cell
note (without a battery every power loss clears the clock again).
## On-device evidence
Single-session serial on /dev/ttyACM0 (see
`.omo/evidence/m1wp/rtc-render-fix-finish-m1-wifi-provisioning.log`):
- Post-flash boot auto-connected Wi-Fi and SNTP-synced the RTC before
the console attached
(pre-manual-set `rtc status` already showed real UTC 2026-08-31
05:17:55, OS bit clear).
- `rtc set 2026-08-31 12:00:00` -> `ESP_OK`; `rtc status` valid and
advancing across polls
(12:14:59 -> 12:15:49); JSONL `utc_valid:true` + non-empty `utc` with 10
s cadence and crc32c.
- Explicit RTS reset round captured live: `frame-time: sntp started
(ntp.aliyun.com,
pool.ntp.org)` and `frame-time: rtc synced from sntp (unix 1788154496)`
7.8 s after reset;
device-vs-host time delta 4 s.
- Pre-fix invalid state (OS bit set -> ESP_ERR_INVALID_CRC) is
documented in the prior soak
evidence (F3 log); the fix clears it on the first SNTP sync.
- KEY latency: no user press within the two assist windows;
console-observer polling at 500 ms
shows counters served immediately from the shared snapshot the display
fast path renders
(CITED: `volatile_signature` + 500 ms check in `display_service.cc`), 10
s heartbeat captured
via memory-metric refresh.
- Regression: `status --json` tf_logging=true, wifi=CONNECTED, selftest
`wifi_config: ok`.
Build 0 warnings; clang-format 18 clean;
pytest/ruff/frame-evidence/frame-doc-links green.
Co-authored-by: ania-lain <[email protected]>
Frame
Draft / PoC: the v4.2 architecture and hardware gates are not signed off. Green cloud CI does not mean M1, PoC-A through PoC-E, power-cut durability, or production security has passed.
Frame is an ESP32-S3 firmware project exploring an embedded plugin architecture. The repository contains the product firmware skeleton, isolated architecture proofs of concept, host-side contract tests, and repository validation tools.
The firmware currently targets the Waveshare ESP32-S3-RLCD-4.2 (N16R8) with ESP-IDF v6.0.2
and requires a toolchain that provides C++26 mode. The custom 16 MiB flash layout contains two
OTA slots, core-dump storage, encrypted NVS, internal plugin storage, and system storage. Signed
plugin resources live on a dedicated FAT32 TF card; dynamic plugins do not start without it.
Repository Layout
main/contains the firmware entry point.components/contains product firmware components.poc/contains isolated architecture proofs of concept and host contract tests.plugins/is reserved for plugin build inputs; installed code is content-addressed at runtime.tools/frame_tools/contains local repository gate commands.
Firmware Build
Install CMake 3.25 or newer and Ninja, then export an ESP-IDF checkout at the exact v6.0.2 tag.
The checked-in presets target esp32s3 and keep generated configuration under .build/.
. "$IDF_PATH/export.sh"
cmake --preset dev
cmake --build --preset dev
Use the production defaults with:
. "$IDF_PATH/export.sh"
cmake --preset prod
cmake --build --preset prod
Production builds are build artifacts, not release attestations. Hardware validation and signing remain separate release concerns.
Host Tests
The host project is a plain CMake/CTest suite. It does not build ESP32 firmware.
cmake -S poc/host -B .build/poc-host -DENABLE_SANITIZERS=ON
cmake --build .build/poc-host
ctest --test-dir .build/poc-host --output-on-failure
Repository Gates
Python 3.11 or newer and uv are required.
uv sync --frozen
uv run ruff format --check tools tests
uv run ruff check tools tests
uv run pyright
uv run pytest
uv run frame-partitions
uv run frame-evidence
uv run frame-doc-links
uv run frame-sbom --output .build/reports/sbom.cdx.json
CI also runs an independent ThreadSanitizer build and enforces at least 90% LLVM branch coverage for the shared ABI, handle, and lifecycle contract headers.
Evidence manifests placed in poc/evidence/ are validated against the existing
poc/evidence/schema.json. The schema itself is always checked, including when no manifests have
been collected yet.
Contributing And Security
Read CONTRIBUTING.md before submitting a change. Report security issues through GitHub private vulnerability reporting as described in SECURITY.md. Community participation is governed by CODE_OF_CONDUCT.md.
License
Except where a file or third-party component states otherwise, this project is licensed under the GNU General Public License, version 3 or later. See LICENSE and NOTICE.