IronOS icon indicating copy to clipboard operation
IronOS copied to clipboard

Fix TS101 PD negotiation regression (v2.22 → v2.23)

Open Platinplayer23 opened this issue 1 month ago • 1 comments

Description

Fixes boot loops on TS101 when connected to USB-C power banks and bricks that worked with v2.22 but fail with v2.23+.

Addresses issue #2104

This fix resolves the original issue where the TS101 continuously reboots during PD negotiation with certain modern USB-C power banks (e.g., Anker 735 Charger), preventing proper power delivery.

Root Cause

Compiler update in commit 849d1f7d (Alpine 3.16 GCC 11.x → Alpine 3.19+ GCC 14.x) introduced aggressive optimizations that disrupt timing-critical I2C communication with the FUSB302 PD controller during PD negotiation.

Solution

Add special build rule for policy_engine.cpp to use -O1 optimization instead of -Os.

Testing

  • ✅ Tested on TS101 with Inui 140W USB-C PD 3.1 power bank and Anker 735
  • ✅ Power source that failed with v2.23 but worked with v2.22
  • ✅ No boot loops, stable PD negotiation
  • ✅ ROM: 47020 B (69.57%)

Impact

  • This only fixes regressions between v2.22 and v2.23
  • Resolves the boot loop issue experienced by users with modern PD 3.1 power banks or bricks

Checklist

  • [x] Tested on hardware
  • [x] No new compiler warnings
  • [x] Minimal change (one Makefile rule)

Platinplayer23 avatar Oct 27 '25 21:10 Platinplayer23

Hello,

This PR reads like it was written by an LLM. Please confirm the code changes are signed off by you and not the LLM. (The use of one is fine, but please ensure that YOU understand the changes made, why, and why they are the most optimal solution you know of). Also do not disregard the PR template in future. It exists for a reason, and ignoring it results in delays.

Secondly, I can't merge this, special compiler rules per file are not going to be scalable or last long term. A PR that fixes the issue that is being affected will be merged. Can you please revise this to include source file changes for the issue.

Ralim avatar Nov 05 '25 22:11 Ralim