From fde68609a70b1f88e09ffef70d8869003b8dc985 Mon Sep 17 00:00:00 2001 From: James Aguilar Date: Wed, 17 Dec 2025 21:21:15 -0700 Subject: [PATCH 1/2] EV3: Fix flashing on Windows. Windows requires a reportid byte at the front of each sent message for an HID device, even if the device doesn't use reportids. Adding this synthetic 0x00 to the front of the message enables successful EV3 flashing on Windows. --- pybricksdev/connections/ev3.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pybricksdev/connections/ev3.py b/pybricksdev/connections/ev3.py index 9c4e2ac..a8e899f 100644 --- a/pybricksdev/connections/ev3.py +++ b/pybricksdev/connections/ev3.py @@ -84,10 +84,17 @@ def _send_command(self, command: Command, payload: bytes | None = None) -> int: length += len(payload) + # report_id is not used by the EV3 but is required by HIDAPI on Windows. + # It does no harm on Linux, so we include it unconditionally. Note that + # the report ID is automatically stripped from incoming messages by + # HIDAPI on all platforms. + report_id = 0 + message_number = next(self._msg_count) message = struct.pack( - " Date: Thu, 15 Jan 2026 21:26:13 -0700 Subject: [PATCH 2/2] squash! EV3: Fix flashing on Windows. Changelog entry. --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70bab64..08981c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed compiling multi-file projects with implicit namespace packages. +- Fixed EV3 firmware upload on Windows ([pybricksdev#128]). + +[pybricksdev#128]: https://github.com/pybricks/pybricksdev/pull/128 ## [2.3.0] - 2025-10-31