Skip to content

Commit 5023280

Browse files
fri3d_2026: remove CH32 workaround for version read, fix version read after install
1 parent d681217 commit 5023280

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

internal_filesystem/lib/drivers/fri3d/expander.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,6 @@ def install_firmware_if_needed(
137137
except Exception as e:
138138
print("Could not check CH32 firmware version, assuming 0.0.0")
139139
current_version = (0, 0, 0)
140-
if current_version == (0, 255, 15):
141-
warning_cb(msg="CH32 firmware version (0,255,15) bug, trying re-read...")
142-
current_version = self.version # re-read seems to work (often?)
143-
if current_version == (0, 255, 15):
144-
warning_cb(msg="CH32 firmware version (0,255,15) bug after re-read, skipping firmware install/update", sleep_ms=4000, r=96, g=21, b=21)
145-
return False
146140
if latest_version <= current_version:
147141
print(f"CH32 firmware {latest_version} <= {current_version} so not updating it")
148142
return False
@@ -152,11 +146,4 @@ def install_firmware_if_needed(
152146
success_cb()
153147
except Exception as e:
154148
failure_cb(e)
155-
return True # re-initialize expander_i2c, even if the install failed, just in case
156-
print("Firmware installed, checking new version")
157-
try:
158-
current_version = self.version
159-
print(f"After install, new current_version of CH32 firmware: {current_version}")
160-
except Exception as e:
161-
print("Could not check CH32 firmware version after install, many things, including LCD RESET, won't work!")
162-
return True
149+
return True # re-initialize expander_i2c, even if the install failed, just in case

internal_filesystem/lib/mpos/board/fri3d_2026.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ def failure(e):
121121
print("Re-initializing expander_i2c")
122122
expander_i2c = I2C(1, sda=Pin(39), scl=Pin(42), freq=400000)
123123
expander = Expander(i2c_bus=expander_i2c)
124+
try:
125+
print(f"CH32 coprocessor firmware version is now: {expander.version}")
126+
except Exception as e:
127+
print("Could not re-check CH32 firmware version. Many things, including LCD RESET, might not work!")
124128

125129
# Make expander accessible later
126130
import mpos

0 commit comments

Comments
 (0)