Skip to content

Commit c3d79a1

Browse files
committed
dfu: fix flashing SPIKE Prime on Windows
The dfu-util.exe wasn't compatible with the .dfu files were were creating and the lack of a leading comma in the --device parameter meant that it looked for a SPIKE Prime in runtime mode rather than DFU mode.
1 parent 136e365 commit c3d79a1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pybricksdev/dfu.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def backup_dfu(file: BinaryIO) -> None:
7777
exit(call([
7878
dfu_util,
7979
"--device",
80-
f"{SPIKE_PRIME_DEVICE},{MINDSTORMS_INVENTOR_DEVICE}",
80+
f",{SPIKE_PRIME_DEVICE},{MINDSTORMS_INVENTOR_DEVICE}",
8181
"--alt",
8282
"0",
8383
"--dfuse-address",
@@ -106,7 +106,7 @@ def restore_dfu(file: BinaryIO) -> None:
106106
exit(call([
107107
dfu_util,
108108
"--device",
109-
f"{SPIKE_PRIME_DEVICE},{MINDSTORMS_INVENTOR_DEVICE}",
109+
f",{SPIKE_PRIME_DEVICE},{MINDSTORMS_INVENTOR_DEVICE}",
110110
"--alt",
111111
"0",
112112
"--dfuse-address",
@@ -190,7 +190,7 @@ def flash_dfu(firmware_bin: bytes, metadata: dict) -> None:
190190
exit(call([
191191
dfu_util,
192192
"--device",
193-
f"{SPIKE_PRIME_DEVICE},{MINDSTORMS_INVENTOR_DEVICE}",
193+
f",{SPIKE_PRIME_DEVICE},{MINDSTORMS_INVENTOR_DEVICE}",
194194
"--alt",
195195
"0",
196196
"--download",

pybricksdev/resources/dfu-util.exe

2.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)