Skip to content

T5S3 ePaper build fix #10791

Open
HarukiToreda wants to merge 10 commits into
developfrom
T5S3_Build_fix
Open

T5S3 ePaper build fix #10791
HarukiToreda wants to merge 10 commits into
developfrom
T5S3_Build_fix

Conversation

@HarukiToreda

@HarukiToreda HarukiToreda commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix board_build.partition -> board_build.partitions so the 16 MB partition layout is actually applied for the T5S3 e-paper target.
  • Re-enable board_check = true for t5s3_epaper_inkhud so the env is validated normally.
  • Avoid redundant GT911 I2C work when t5TouchSetForcedByTimeout() is called without a state change during PowerFSM re-entry.
  • Prevent T5S3 native USB CDC logging from blocking boot while the host re-enumerates the serial port after reset.

Validation

  • pio run -e t5s3_epaper_inkhud — successful

Summary by CodeRabbit

  • Bug Fixes
    • Improved startup serial behavior on devices using native USB, reducing the chance of console timeouts during boot.
    • Fixed touch timeout handling so the screen state and touch indicator refresh correctly without putting the controller to sleep.
    • Updated device configuration for the t5s3 epaper variant to better match the current hardware setup.

@HarukiToreda HarukiToreda self-assigned this Jun 25, 2026
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Flash this PR in the Web Flasher

firmware commit boards expires

Warning

This is an automated, unreviewed CI test build. Back up your device configuration
before flashing, and only flash devices you are able to recover.

Supported boards built by this PR (25)
Device Board Platform
Crowpanel Adv 3.5 TFT elecrow-adv-35-tft esp32-s3
Heltec HT62 heltec-ht62-esp32c3-sx1262 esp32-c3
Heltec Mesh Node 096 heltec-mesh-node-t096 nrf52840
Heltec Mesh Node T1 heltec-mesh-node-t1 nrf52840
Heltec Mesh Node T114 heltec-mesh-node-t114 nrf52840
Heltec V3 heltec-v3 esp32-s3
Heltec V4 heltec-v4 esp32-s3
Raspberry Pi Pico pico rp2040
Raspberry Pi Pico W picow rp2040
RAK WisMesh Tag rak_wismeshtag nrf52840
RAK WisBlock 11200 rak11200 esp32
RAK WisBlock 11310 rak11310 rp2040
RAK3312 rak3312 esp32-s3
RAK WisBlock 4631 rak4631 nrf52840
Seeed Wio Tracker L1 seeed_wio_tracker_L1 nrf52840
Seeed Xiao NRF52840 Kit seeed_xiao_nrf52840_kit nrf52840
Seeed Xiao ESP32-S3 seeed-xiao-s3 esp32-s3
Station G2 station-g2 esp32-s3
Station G3 station-g3 esp32-s3
LILYGO T-Deck t-deck-tft esp32-s3
LILYGO T-Echo t-echo nrf52840
LILYGO T-Echo Plus t-echo-plus nrf52840
LILYGO T-Impulse Plus t-impulse-plus nrf52840
LilyGo T3-C6 tlora-c6 esp32-c6
Seeed SenseCAP T1000-E tracker-t1000-e nrf52840

Build artifacts expire on 2026-07-29. Updated for 7f5bc5b.

@HarukiToreda HarukiToreda added the bug Something isn't working label Jun 25, 2026
@github-actions github-actions Bot added the bugfix Pull request that fixes bugs label Jun 25, 2026

@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: 9368009727

ℹ️ 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 thread src/platform/extra_variants/t5s3_epaper/variant.cpp
@HarukiToreda HarukiToreda marked this pull request as draft June 25, 2026 19:23
@HarukiToreda HarukiToreda marked this pull request as ready for review June 28, 2026 03:34

@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: dcaea07a3f

ℹ️ 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 thread src/platform/extra_variants/t5s3_epaper/variant.cpp
@HarukiToreda HarukiToreda added hardware-support Hardware related: new devices or modules, problems specific to hardware and removed bug Something isn't working labels Jun 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Firmware Size Report

22 targets | vs develop: 22 increased, net +10,144 (+9.9 KB)

Target Size vs develop
heltec-vision-master-e213-inkhud 2,230,176 📈 +2,816 (+2.8 KB)
station-g3 2,266,784 📈 +432
rak11200 1,861,024 📈 +416
station-g2 2,266,768 📈 +416
t-deck-tft 3,811,088 📈 +416
Show 17 more target(s)
Target Size vs develop
heltec-ht62-esp32c3-sx1262 2,135,392 📈 +400
heltec-v3 2,264,480 📈 +400
heltec-v4 2,277,696 📈 +400
rak3312 2,272,640 📈 +400
tlora-c6 2,368,704 📈 +400
seeed-xiao-s3 2,276,528 📈 +384
pico2w 1,220,884 📈 +368
t-eth-elite 2,491,856 📈 +368
elecrow-adv-35-tft 3,416,976 📈 +352
pico2 770,128 📈 +352
seeed_xiao_rp2350 768,272 📈 +336
pico 783,008 📈 +320
rak11310 805,744 📈 +320
picow 1,245,184 📈 +304
seeed_xiao_rp2040 781,208 📈 +304
wio-e5 238,756 📈 +128
rak3172 186,408 📈 +112

Updated for a62e18b

@thebentern thebentern requested a review from Copilot June 29, 2026 11:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Fixes build/config issues for the T5S3 ePaper inkhud environment and adjusts runtime behavior around touch handling and USB CDC logging.

Changes:

  • Apply the correct 16MB partition layout and re-enable environment validation for t5s3_epaper_inkhud.
  • Add a target-specific custom_component_remove list to avoid removing network_provisioning for this env.
  • Reduce redundant touch-controller work and avoid USB CDC logging stalls during reboot/re-enumeration.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
variants/esp32s3/t5s3_epaper/platformio.ini Fixes partition config key, re-enables board_check, and scopes component removal to the inkhud env.
src/platform/extra_variants/t5s3_epaper/variant.cpp Adds an early-return to avoid redundant work and changes GT911 sleep/wake behavior when timeout forcing toggles.
src/SerialConsole.cpp Attempts to prevent native USB CDC logging from blocking boot by setting TX timeout for a specific target.

Comment thread src/platform/extra_variants/t5s3_epaper/variant.cpp
Comment thread src/platform/extra_variants/t5s3_epaper/variant.cpp
Comment thread src/SerialConsole.cpp
Comment thread variants/esp32s3/t5s3_epaper/platformio.ini
Comment thread variants/esp32s3/t5s3_epaper/platformio.ini Outdated
Per Vid, this is not needed once his PR is merged
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes adjust SerialConsole to disable TX timeout for native USB serial on T5 S3 ePaper Pro, modify GT911 touch controller forced-timeout logic to skip sleep and add an early-return guard, and update platformio.ini partition key naming and board_check/board_level settings for the inkhud environment.

Changes

T5 S3 ePaper Fixes

Layer / File(s) Summary
Serial console USB TX timeout handling
src/SerialConsole.cpp
Adds conditional TX timeout disabling for native USB serial on T5_S3_EPAPER_PRO during construction; adjusts closing brace placement in `log_to_serial`.
Touch forced-timeout state logic
src/platform/extra_variants/t5s3_epaper/variant.cpp
`t5TouchSetForcedByTimeout` early-returns on unchanged state, no longer sleeps the GT911 controller when timeout is enabled, and clears `touchNeedsWake` in both forced and unforced paths instead of deferring wake.
Board partition and check configuration
variants/esp32s3/t5s3_epaper/platformio.ini
Renames `board_build.partition` to `board_build.partitions`; sets `board_check` to true and adds `board_level = extra` for `env:t5s3_epaper_inkhud`.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A rabbit hops through timeouts and touch,
No more sleep for GT911, not so much!
Partitions renamed, checks turned on true,
Small burrows of code, all tidied for you. 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and matches the main T5S3 ePaper build-related changes, though it omits the runtime fixes.
Description check ✅ Passed The description includes a clear summary and validation, but it omits the template's attestations/testing checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/platform/extra_variants/t5s3_epaper/variant.cpp`:
- Around line 429-435: The timeout handling in the touch wake logic leaves
touchNeedsWake stale when forced transitions back to false during light sleep,
so the controller never gets a deferred wake. Update the forced branch in
variant.cpp near the touch wake state logic so it mirrors setTouchInputEnabled:
assign touchNeedsWake based on touchControllerReady first, then only clear it
when touchLightSleepActive is false or touch input is not enabled. Use the
existing touchNeedsWake, touchControllerReady, touchLightSleepActive, and
touchInputEnabled checks to ensure readTouch() can trigger the wake after
timeout clears.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e355fc7e-a8ec-4a8c-8aa2-12462f56a884

📥 Commits

Reviewing files that changed from the base of the PR and between d4db80e and 41e90eb.

📒 Files selected for processing (3)
  • src/SerialConsole.cpp
  • src/platform/extra_variants/t5s3_epaper/variant.cpp
  • variants/esp32s3/t5s3_epaper/platformio.ini

Comment on lines 429 to 435
if (forced) {
// While timeout-forced, keep controller asleep to avoid stale IRQ chatter.
// Timeout only gates touch input in software. Avoid GT911 I2C here because
// PowerFSM same-state transitions can fire from phone contact and screen timeout.
touchNeedsWake = false;
if (touchControllerReady && !touchLightSleepActive) {
touch.sleep();
}
} else if (touchInputEnabled && touchControllerReady && !touchLightSleepActive) {
// Defer wake until readTouch() so I2C settles post-state transition.
touchNeedsWake = true;
touchNeedsWake = false;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Touch never wakes when un-forcing timeout during light sleep.

When forced becomes false (timeout ends), touchNeedsWake is only cleared when the controller is already awake (!touchLightSleepActive). If touchLightSleepActive is true at that moment, touchNeedsWake is left untouched — and since the sibling forced == true branch always sets it to false, it will almost certainly still be false. readTouch() only wakes the controller when touchNeedsWake && touchControllerReady (line 595), so the deferred wake is never triggered and touch stays asleep/unresponsive after the timeout clears.

Compare with setTouchInputEnabled (lines 476-478), which unconditionally sets touchNeedsWake = touchControllerReady before conditionally clearing it — that pattern correctly defers the wake when light-sleeping.

🐛 Proposed fix mirroring setTouchInputEnabled's pattern
     if (forced) {
         // Timeout only gates touch input in software. Avoid GT911 I2C here because
         // PowerFSM same-state transitions can fire from phone contact and screen timeout.
         touchNeedsWake = false;
-    } else if (touchInputEnabled && touchControllerReady && !touchLightSleepActive) {
-        touchNeedsWake = false;
+    } else if (touchInputEnabled && touchControllerReady) {
+        touchNeedsWake = touchLightSleepActive;
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (forced) {
// While timeout-forced, keep controller asleep to avoid stale IRQ chatter.
// Timeout only gates touch input in software. Avoid GT911 I2C here because
// PowerFSM same-state transitions can fire from phone contact and screen timeout.
touchNeedsWake = false;
if (touchControllerReady && !touchLightSleepActive) {
touch.sleep();
}
} else if (touchInputEnabled && touchControllerReady && !touchLightSleepActive) {
// Defer wake until readTouch() so I2C settles post-state transition.
touchNeedsWake = true;
touchNeedsWake = false;
}
if (forced) {
// Timeout only gates touch input in software. Avoid GT911 I2C here because
// PowerFSM same-state transitions can fire from phone contact and screen timeout.
touchNeedsWake = false;
} else if (touchInputEnabled && touchControllerReady) {
touchNeedsWake = touchLightSleepActive;
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/platform/extra_variants/t5s3_epaper/variant.cpp` around lines 429 - 435,
The timeout handling in the touch wake logic leaves touchNeedsWake stale when
forced transitions back to false during light sleep, so the controller never
gets a deferred wake. Update the forced branch in variant.cpp near the touch
wake state logic so it mirrors setTouchInputEnabled: assign touchNeedsWake based
on touchControllerReady first, then only clear it when touchLightSleepActive is
false or touch input is not enabled. Use the existing touchNeedsWake,
touchControllerReady, touchLightSleepActive, and touchInputEnabled checks to
ensure readTouch() can trigger the wake after timeout clears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs hardware-support Hardware related: new devices or modules, problems specific to hardware

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants