Skip to content

feat(read-pico): add MindReset Read Pico support - #10

Merged
eMUQI merged 7 commits into
mainfrom
read-pico-target
Oct 6, 2026
Merged

eMUQI merged 7 commits into
mainfrom
read-pico-target

Conversation

@eMUQI

@eMUQI eMUQI commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Summary

Add MindReset Read Pico (ESP32-S3, 684 × 1216 sixteen-gray e-paper) as a maintained target.

  • New target firmware/targets/mindreset_read_pico (application mr_read_pico): Home with both services, alarm states and a 24-hour trend; clock; landscape Home; pairing; OTA progress and confirmation; Display settings; offline state. Usage publication, time synchronization and OTA reuse the shared BLE protocol.
  • Board components are vendored from MindReset/read_pico_firmware at 28cde68; provenance, licenses and local changes are recorded in components/UPSTREAM.md and THIRD_PARTY_LICENSES.md.
  • Register the target in the Target Registry, so CI builds it and releases publish mindreset-read-pico-ota- and -full- images. It has no web flasher entry yet.
  • Host preview under tools/read_pico/preview/ renders the views with the firmware drawing code and checks the touch targets.
  • List the device in the README, device guide, firmware and protocol references, and the release asset contract.
  • Bridge (macOS): retain the device adoption task while CoreBluetooth awaits a native callback.

Validation

  • Bridge registry, release assembler, release workflow and web flasher tests pass.
  • idf.py build for mindreset_read_pico with ESP-IDF v6.1 succeeds without changing dependencies.lock.
  • tools/read_pico/preview/run.sh builds and passes on the host.

eMUQI added 4 commits October 6, 2026 10:15
List Read Pico in the firmware and protocol references, correct its font
subset record, describe the diagnostic views directly, and document the
board and view interfaces. Drop pending-verification remarks from the
Bridge, Mosaico and ePaper notes.
Add MindReset Read Pico to the Target Registry without a web flasher
entry, and list it in the device, firmware and release references.
@eMUQI

eMUQI commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T03:16:19.000033Z cd40500 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e7cb6291c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +67 to +68
read_pico_sd_info_t sd{};
v.sd = read_pico_sd_get_info(&sd) == ESP_OK && sd.mounted;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Re-probe the SD card after media changes

When the device boots without a card, the one startup probe leaves the SD driver in its completed/unmounted state, and this polling path only calls read_pico_sd_get_info(), which never starts another mount. Likewise, removing a mounted card permanently sets the driver's media_invalidated flag until read_pico_sd_remount() is called. Consequently, inserting or reinserting a FAT card while the firmware is running never enables trend persistence; detect the presence transition here and trigger the remount/probe path.

Useful? React with 👍 / 👎.

Comment thread bridge/README.md
滚动仅处理图标范围内的纵向事件,触控板惯性滚动不触发翻页,连续操作最多每 200 ms 翻一页。

菜单按已添加的设备显示固件更新项,包含新版提示、等待设备确认、传输百分比和重连状态。点击后下载并校验固件,在桌面确认设备、来源、版本和摘要,再通过蓝牙更新;设备仍需逐次物理确认。下载与桌面确认不占独占连接,期间继续同步用量。macOS OTA 软件流程已接入,实机升级、重连和数据恢复仍待验收。
菜单按已添加的设备显示固件更新项,包含新版提示、等待设备确认、传输百分比和重连状态。点击后下载并校验固件,在桌面确认设备、来源、版本和摘要,再通过蓝牙更新;设备仍需逐次物理确认。下载与桌面确认不占独占连接,期间继续同步用量。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore the macOS OTA verification caveat

This deletion removes the only nearby distinction between the implemented macOS OTA software flow and hardware validation, while docs/verification.md still states that macOS OTA for every target remains pending. The remaining paragraph now presents transfer, confirmation, and reconnection as an unqualified supported workflow, so release readers can mistake unverified device behavior and recovery for completed validation; restore the caveat unless corresponding hardware acceptance evidence is added.

AGENTS.md reference: AGENTS.md:L7-L7

Useful? React with 👍 / 👎.

req->code = code;
req->payload_length = plen;
req->session_id = s_snap.boot_id;
if (payload != NULL && plen > 0) memcpy(req->payload, payload, plen);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject oversized PMU command payloads

If any caller passes plen > PMU_FRAME_PAYLOAD_SIZE (44), this memcpy writes past pmu_frame_t::payload and corrupts the request's trailing CRC and adjacent stack data before the frame is transmitted. read_pico_pmu_cmd() is a public component API and accepts an unrestricted uint8_t length, so it should reject oversized payloads—and nonzero lengths with a null payload—before calling fill_req().

Useful? React with 👍 / 👎.

@eMUQI
eMUQI force-pushed the read-pico-target branch from 356d458 to 1e7cb62 Compare October 6, 2026 02:40
eMUQI added 2 commits October 6, 2026 10:43
The SD driver probes once at boot and latches removal until an explicit
remount, so a card inserted or reinserted later never enabled trend
storage. Request a remount when the card-detect input reports a new card.
@eMUQI

eMUQI commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd40500f9c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

uint8_t ident[PMU_IDENTITY_SIZE];
err = pmu_read_reg(PMU_REG_IDENTITY, ident, sizeof(ident));
if (err == ESP_OK) {
parse_identity(ident);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve the successful PMU identity result

s_snap is zeroed at initialization, but the successful identity read discards parse_identity()'s return value, and recover_seq() does the same. Consequently s_snap.identity_ok remains false, s_ready is false at the later readiness check, and every otherwise healthy CW32 is deinitialized as an invalid response; the board then loses factory VCOM, RTC, battery/charging data, and OTA power authorization.

Useful? React with 👍 / 👎.

Comment on lines +141 to +142
ota_partition_bytes=4 * 1024 * 1024,
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add Read Pico to the browser flasher registry

This target leaves web_flash at its None default, so both scripts/export_web_devices.py and scripts/assemble_web_flasher.py explicitly filter Read Pico out of the website device list and firmware manifests. Users following the newly updated Quick Start therefore cannot select this supported model in the advertised web flasher; provide its WebFlashDefinition and asset, or qualify the installation documentation.

Useful? React with 👍 / 👎.

Comment on lines +217 to +219
static bool loaded = false;
if (!loaded) {
loaded = true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reload trend history after an SD-card replacement

After a mounted card is removed and another card is inserted, the remount path restores v.sd, but this process-lifetime loaded flag remains true. The new card's trend.bin is therefore never read; instead the old card's in-memory history is displayed and then written onto the replacement card at the next half-hour sample. Reset or key the loaded state when media changes.

Useful? React with 👍 / 👎.

Comment on lines 18 to +19
used monochrome refreshes: a full refresh on entry and after 20 partial
updates, with partial refreshes for progress updates; power-loss recovery and rollback
remain unverified.
updates, with partial refreshes for progress updates.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore the ePaper OTA recovery caveat

This verification paragraph only records a normal OTA run, while docs/verification.md still says power interruption, failed-start rollback, and related failure paths remain outstanding for maintained targets. Removing the only target-specific caveat makes those untested device behaviors appear covered by the successful transfer; retain the recovery limitation alongside the observed result.

AGENTS.md reference: AGENTS.md:L7-L7

Useful? React with 👍 / 👎.

Comment on lines +203 to +204
for (int i = 0; i < CST836U_MAX_POINTS; i++) {
const uint8_t* src = &data[3 + i * 6];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Parse only the touch contacts reported by the controller

When the CST836U reports fewer than two contacts, this loop still decodes both coordinate slots instead of stopping at touch->count. An unused or stale slot whose bytes encode event 0/2 and ID 0/1 is counted as active, so a zero-contact packet can leave touch.touched true and Board::input() never observes the release needed to emit taps or capacitive-key presses; restrict parsing and primary-point selection to the reported active contacts.

Useful? React with 👍 / 👎.

Comment on lines +290 to +291
if (ui.ready())
ble.verify_boot();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Do not confirm OTA when panel power-up failed

When a pending image boots but sy7636a_power_on() fails or PGOOD times out, board_poweron() returns without enabling the panel rails, while the subsequent epdiy transfer can still return EPD_DRAW_SUCCESS; ui.ready() then becomes true and this call permanently marks the image valid even though no frame reached the display. Include the rail/PGOOD state in display readiness before calling verify_boot() so a firmware-caused panel power regression can still roll back.

Useful? React with 👍 / 👎.

epdiy reports a successful update when the SY7636A rails failed to power
up, which let a pending OTA image be marked valid without a displayed
frame. Treat a refresh without rails as failed.

Reload the trend history when a card is mounted again so history from a
previous card is not written onto its replacement, and note in the Quick
Start that Read Pico installs from the release image.
@eMUQI
eMUQI merged commit d6e756c into main Oct 6, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant