Tue, 29 Oct 2024 10:59:48 +0100
MicroPython
- Updated the list of known CircuitPython boards for CPy 9.2.0.
- Updated the list of known UF2 capable boards.
8096 | 1 | # -*- coding: utf-8 -*- |
2 | ||
10439
21c28b0f9e41
Updated copyright for 2024.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10373
diff
changeset
|
3 | # Copyright (c) 2021 - 2024 Detlev Offenbach <detlev@die-offenbachs.de> |
8096 | 4 | # |
5 | ||
6 | """ | |
7 | Module implementing a dialog to flash any UF2 capable device. | |
8 | """ | |
9 | ||
10172 | 10 | import contextlib |
8096 | 11 | import os |
12 | import shutil | |
13 | ||
9473
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
14 | from PyQt6.QtCore import QCoreApplication, QEventLoop, Qt, QThread, pyqtSlot |
9482
a2bc06a54d9d
Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9473
diff
changeset
|
15 | from PyQt6.QtSerialPort import QSerialPortInfo |
9815 | 16 | from PyQt6.QtWidgets import QDialog, QInputDialog |
8096 | 17 | |
9473
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
18 | from eric7.EricGui import EricPixmapCache |
9903 | 19 | from eric7.EricWidgets import EricMessageBox |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9248
diff
changeset
|
20 | from eric7.EricWidgets.EricApplication import ericApp |
9473
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
21 | from eric7.EricWidgets.EricPathPicker import EricPathPickerModes |
10253
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
22 | from eric7.SystemUtilities import FileSystemUtilities, OSUtilities |
8096 | 23 | |
9759
4543b7876047
Adapted some MicroPython modules to the new package layout.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9736
diff
changeset
|
24 | from . import Devices |
9473
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
25 | from .Ui_UF2FlashDialog import Ui_UF2FlashDialog |
8096 | 26 | |
27 | SupportedUF2Boards = { | |
28 | "circuitpython": { | |
29 | "volumes": { | |
30 | (0x03EB, 0x2402): [ | |
9903 | 31 | ("SAMD21", "SAMD21 Board"), |
32 | ("SAME54", "SAME54 Board"), | |
8096 | 33 | ], |
9248 | 34 | (0x04D8, 0xE799): [ |
10208 | 35 | ("ZEROBOOT", "Maker Zero SAMD21"), |
9248 | 36 | ], |
8096 | 37 | (0x04D8, 0xEC44): [ |
9903 | 38 | ("PYCUBEDBOOT", "PyCubedv04"), |
8096 | 39 | ], |
40 | (0x04D8, 0xEC63): [ | |
9903 | 41 | ("BOOT", "CircuitBrains Basic"), |
8096 | 42 | ], |
43 | (0x04D8, 0xEC64): [ | |
9903 | 44 | ("BOOT", "CircuitBrains Deluxe"), |
8096 | 45 | ], |
46 | (0x04D8, 0xED5F): [ | |
9903 | 47 | ("UCHIPYBOOT", "uChip CircuitPython"), |
8096 | 48 | ], |
49 | (0x04D8, 0xEDB3): [ | |
9903 | 50 | ("USBHUBBOOT", "Programmable USB Hub"), |
8096 | 51 | ], |
52 | (0x04D8, 0xEDBE): [ | |
9903 | 53 | ("SAM32BOOT", "SAM32"), |
8096 | 54 | ], |
55 | (0x04D8, 0xEF66): [ | |
9903 | 56 | ("SENSEBOX", "senseBox MCU"), |
8096 | 57 | ], |
58 | (0x1209, 0x2017): [ | |
9903 | 59 | ("MINISAMBOOT", "Mini SAM M4"), |
8096 | 60 | ], |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
61 | (0x1209, 0x3252): [ |
9903 | 62 | ("MCBS2OMBOOT", "Module Clip w/Wroom"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
63 | ], |
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
64 | (0x1209, 0x3253): [ |
9903 | 65 | ("MCBS2ERBOOT", "Module Clip w/Wrover"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
66 | ], |
8096 | 67 | (0x1209, 0x4D44): [ |
9903 | 68 | ("ROBOM0BOOT", "Robo HAT MM1"), |
69 | ("ROBOM4BOOT", "Robo HAT MM1 M4"), | |
8096 | 70 | ], |
71 | (0x1209, 0x4DDD): [ | |
9903 | 72 | ("SapBOOT", "CP Sapling"), |
8096 | 73 | ], |
74 | (0x1209, 0x7102): [ | |
9903 | 75 | ("MINISAMBOOT", "Mini SAM M0"), |
8096 | 76 | ], |
9248 | 77 | (0x1209, 0x7380): [ |
9903 | 78 | ("CH840BOOT", "ILabs Challenger 840"), |
9248 | 79 | ], |
8919 | 80 | (0x1209, 0x7A01): [ |
9903 | 81 | ("MIKOTO-BOOT", "Mikoto nRF52840"), |
8919 | 82 | ], |
8096 | 83 | (0x1209, 0x805A): [ |
9903 | 84 | ("BASTBLE", "Bast BLE"), |
8096 | 85 | ], |
86 | (0x1209, 0xE3E2): [ | |
9903 | 87 | ("StackRduino", "StackRduino M0 PRO"), |
8096 | 88 | ], |
89 | (0x1209, 0xF501): [ | |
9903 | 90 | ("M4SHIMBOOT", "M4-Shim"), |
8096 | 91 | ], |
10840 | 92 | (0x1209, 0xFE06): [ |
93 | ("POSTBOOT", "POST Box"), | |
94 | ], | |
95 | (0x1209, 0xFE07): [ | |
96 | ("ARCBOOT", "Arcflash"), | |
97 | ], | |
11010 | 98 | (0x15BA, 0x0046): [ |
99 | ("RT1010BOOT", "RT1010"), | |
100 | ], | |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
101 | (0x15BA, 0x28DC): [ |
9903 | 102 | ("OLMLIPOBOOT", "ESP32S2 DevKit Lipo"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
103 | ], |
8096 | 104 | (0x16D0, 0x0CDA): [ |
9903 | 105 | ("AUTOMAT", "automat"), |
8096 | 106 | ], |
9614 | 107 | (0x16D0, 0x10ED): [ |
9903 | 108 | ("PillBug", "PillBug"), |
9614 | 109 | ], |
10840 | 110 | (0x1B4F, 0x0016): [ |
111 | ("51THINGBOOT", "SAMD51 Thing+"), | |
112 | ], | |
9248 | 113 | (0x1B4F, 0x0019): [ |
9903 | 114 | ("QwiicMicro", "Qwiic Micro SamD21"), |
9248 | 115 | ], |
10840 | 116 | (0x1B4F, 0x0020): [ |
117 | ("MIMOBOOT", "MicroMod SAMD51 Processor Board"), | |
118 | ], | |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
119 | (0x1B4F, 0x0022): [ |
9903 | 120 | ("SFMM852BOOT", "MicroMod nRF52840"), |
8096 | 121 | ], |
8956 | 122 | (0x1B4F, 0x002C): [ |
9903 | 123 | ("THNG+32BOOT", "Thing Plus - STM32"), |
8956 | 124 | ], |
10626 | 125 | (0x1B4F, 0x002D): [ |
126 | ("MM-F405BOOT", "MicroMod STM32F405"), | |
127 | ], | |
8096 | 128 | (0x1B4F, 0x0D22): [ |
9903 | 129 | ("SPARKFUN", "SAMD21 Mini Breakout"), |
8096 | 130 | ], |
131 | (0x1B4F, 0x0D23): [ | |
9903 | 132 | ("SPARKFUN", "SAMD21 Dev Breakout"), |
8096 | 133 | ], |
134 | (0x1D50, 0x6110): [ | |
9903 | 135 | ("ROBOTICS", "Robotics"), |
8096 | 136 | ], |
137 | (0x1D50, 0x6112): [ | |
9903 | 138 | ("RCBOOT", "Wattuino RC"), |
8096 | 139 | ], |
8919 | 140 | (0x1D50, 0x6157): [ |
9903 | 141 | ("BBOARDBOOT", "nRF52840 BBoard"), |
8919 | 142 | ], |
8096 | 143 | (0x1D50, 0x6160): [ |
9903 | 144 | ("BLUEMICRO", "BlueMicro"), |
8096 | 145 | ], |
8919 | 146 | (0x1D50, 0x616F): [ |
9903 | 147 | ("BLUEMICRO", "BlueMicro"), |
8919 | 148 | ], |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
149 | (0x1FC9, 0x0094): [ |
9903 | 150 | ("DblM33BOOT", "Double M33"), |
151 | ("LPC5528BOOT", "LPCXpresso 55s28"), | |
152 | ("LPC5569BOOT", "LPCXpresso 55s69"), | |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
153 | ], |
8919 | 154 | (0x1FC9, 0x0154): [ |
9903 | 155 | ("K32L2BOOT", "FRDM-K32L2B3"), |
156 | ("K32L2BOOT", "KUIIC"), | |
8919 | 157 | ], |
8096 | 158 | (0x230A, 0x00E9): [ |
9903 | 159 | ("TAU_BOOT", "Tau"), |
8096 | 160 | ], |
161 | (0x2341, 0x0057): [ | |
9903 | 162 | ("NANOBOOT", "NANO 33 IoT"), |
8096 | 163 | ], |
164 | (0x2341, 0x8053): [ | |
9903 | 165 | ("MKR1300", "MKR1300"), |
166 | ], | |
167 | (0x2341, 0x8056): [ | |
168 | ("VIDOR4000", "MKR Vidor 4000"), | |
8096 | 169 | ], |
170 | (0x239A, 0x000F): [ | |
9903 | 171 | ("ITSYBOOT", "ItsyBitsy M0 Express"), |
8096 | 172 | ], |
173 | (0x239A, 0x0013): [ | |
9903 | 174 | ("METROBOOT", "Metro M0"), |
8096 | 175 | ], |
176 | (0x239A, 0x0015): [ | |
9903 | 177 | ("FEATHERBOOT", "Feather M0"), |
8096 | 178 | ], |
179 | (0x239A, 0x0018): [ | |
9903 | 180 | ("CPLAYBOOT", "CPlay Express"), |
8096 | 181 | ], |
182 | (0x239A, 0x001B): [ | |
9903 | 183 | ("FEATHERBOOT", "Feather M0 Express"), |
8096 | 184 | ], |
185 | (0x239A, 0x001C): [ | |
9903 | 186 | ("GEMMABOOT", "Gemma M0"), |
8096 | 187 | ], |
188 | (0x239A, 0x001E): [ | |
9903 | 189 | ("TRINKETBOOT", "Trinket M0"), |
8096 | 190 | ], |
191 | (0x239A, 0x0021): [ | |
10626 | 192 | ("METROM4BOOT", "Metro M4 Rev B"), |
8096 | 193 | ], |
194 | (0x239A, 0x0022): [ | |
9903 | 195 | ("ARCADE-D5", "Feather Arcade D51"), |
196 | ("FEATHERBOOT", "Feather M4 Express"), | |
8096 | 197 | ], |
198 | (0x239A, 0x0024): [ | |
9903 | 199 | ("RADIOBOOT", "Radiofruit M0"), |
8096 | 200 | ], |
201 | (0x239A, 0x0027): [ | |
9903 | 202 | ("PIRKEYBOOT", "pIRKey M0"), |
8096 | 203 | ], |
204 | (0x239A, 0x0029): [ | |
10208 | 205 | ("ARCADE-N4", "Feather nRF52840 Express"), |
9903 | 206 | ("FTHR833BOOT", "Feather nRF52833 Express"), |
207 | ("FTHR840BOOT", "Feather nRF52840 Express"), | |
208 | ("MDK840DONGL", "MDK nRF52840 USB Dongle"), | |
209 | ("WS52840EVK", "Waveshare nRF52840 Eval"), | |
8096 | 210 | ], |
211 | (0x239A, 0x002B): [ | |
9903 | 212 | ("ARCADE-D5", "Itsy Arcade D51"), |
213 | ("ITSYM4BOOT", "ItsyBitsy M4 Express"), | |
8096 | 214 | ], |
215 | (0x239A, 0x002D): [ | |
9903 | 216 | ("CRICKITBOOT", "crickit"), |
8096 | 217 | ], |
218 | (0x239A, 0x002F): [ | |
9903 | 219 | ("TRELM4BOOT", "Trellis M4 Express"), |
8096 | 220 | ], |
221 | (0x239A, 0x0031): [ | |
9903 | 222 | ("GCM4BOOT", "Grand Central M4 Express"), |
8096 | 223 | ], |
224 | (0x239A, 0x0033): [ | |
9903 | 225 | ("PYBADGEBOOT", "PyBadge"), |
8096 | 226 | ], |
227 | (0x239A, 0x0034): [ | |
9903 | 228 | ("BADGELCBOOT", "BadgeLC"), |
229 | ("PEWBOOT", "PewPew"), | |
8096 | 230 | ], |
231 | (0x239A, 0x0035): [ | |
9903 | 232 | ("MKRZEROBOOT", "MKRZero"), |
233 | ("PORTALBOOT", "PyPortal M4 Express"), | |
8096 | 234 | ], |
235 | (0x239A, 0x0037): [ | |
9903 | 236 | ("METROM4BOOT", "Metro M4 AirLift"), |
8096 | 237 | ], |
238 | (0x239A, 0x003D): [ | |
9903 | 239 | ("PYGAMERBOOT", "PyGamer"), |
8096 | 240 | ], |
241 | (0x239A, 0x003F): [ | |
9903 | 242 | ("METR840BOOT", "Metro nRF52840 Express"), |
8096 | 243 | ], |
244 | (0x239A, 0x0045): [ | |
9903 | 245 | ("CPLAYBTBOOT", "Circuit Playground nRF52840"), |
8096 | 246 | ], |
247 | (0x239A, 0x0047): [ | |
9903 | 248 | ("MASKM4BOOT", "Hallowing Mask M4"), |
8096 | 249 | ], |
250 | (0x239A, 0x0049): [ | |
9903 | 251 | ("HALLOM4BOOT", "HalloWing M4"), |
8096 | 252 | ], |
253 | (0x239A, 0x004D): [ | |
9903 | 254 | ("SNEKBOOT", "snekboard"), |
8096 | 255 | ], |
256 | (0x239A, 0x0051): [ | |
9903 | 257 | ("ITSY840BOOT", "ItsyBitsy nRF52840 Express"), |
8096 | 258 | ], |
259 | (0x239A, 0x0057): [ | |
9903 | 260 | ("SERPENTBOOT", "Serpente"), |
8096 | 261 | ], |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
262 | (0x239A, 0x0059): [ |
9903 | 263 | ("FTHR405BOOT", "Feather STM32F405 Express"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
264 | ], |
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
265 | (0x239A, 0x005D): [ |
9903 | 266 | ("BlackPill", "STM32F401CxUx"), |
10626 | 267 | ("MiniSTM32H7", "STM32FH750VBT6"), |
9903 | 268 | ("STMF411BOOT", "STM32F411 Discovery"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
269 | ], |
8096 | 270 | (0x239A, 0x0061): [ |
9903 | 271 | ("SOLBOOT", "Sol"), |
8096 | 272 | ], |
273 | (0x239A, 0x0063): [ | |
9903 | 274 | ("NANO33BOOT", "Nano 33 BLE"), |
8096 | 275 | ], |
276 | (0x239A, 0x0065): [ | |
9903 | 277 | ("ND6BOOT", "ndBit6"), |
8096 | 278 | ], |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
279 | (0x239A, 0x0069): [ |
9903 | 280 | ("STMF411BOOT", "STM32F411 BlackPill"), |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
281 | ], |
8096 | 282 | (0x239A, 0x006B): [ |
9903 | 283 | ("shIRtty", "shIRtty"), |
8096 | 284 | ], |
285 | (0x239A, 0x0071): [ | |
9903 | 286 | ("CLUEBOOT", "CLUE nRF52840"), |
8096 | 287 | ], |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
288 | (0x239A, 0x0077): [ |
9903 | 289 | ("RT1010BOOT", "RT1010 EVK"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
290 | ], |
8096 | 291 | (0x239A, 0x0079): [ |
9903 | 292 | ("ARAMBOOT", "ARAMCON Badge 2019"), |
8096 | 293 | ], |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
294 | (0x239A, 0x007B): [ |
9903 | 295 | ("ARAMBOOT", "ARAMCON2 Badge"), |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
296 | ], |
8096 | 297 | (0x239A, 0x007D): [ |
9903 | 298 | ("BOOKBOOT", "The Open Book Feather"), |
8096 | 299 | ], |
300 | (0x239A, 0x007F): [ | |
9903 | 301 | ("BADGEBOOT", "OHS2020 Badge"), |
8096 | 302 | ], |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
303 | (0x239A, 0x0081): [ |
9903 | 304 | ("RT1020BOOT", "RT1020 EVK"), |
305 | ("RT1024BOOT", "RT1024 EVK"), | |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
306 | ], |
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
307 | (0x239A, 0x0083): [ |
9903 | 308 | ("RT1060BOOT", "RT1060 EVK"), |
309 | ("RT1064BOOT", "RT1064 EVK"), | |
310 | ], | |
311 | (0x239A, 0x0085): [ | |
312 | ("TNSY40BOOT", "Teensy 4.0"), | |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
313 | ], |
8096 | 314 | (0x239A, 0x0087): [ |
9903 | 315 | ("FTHRSNSBOOT", "Feather nRF52840 Sense"), |
10626 | 316 | ("SENSTFTBOOT", "Feather nRF52840 Sense TFT"), |
8096 | 317 | ], |
318 | (0x239A, 0x0093): [ | |
9903 | 319 | ("ISVITABoot", "IkigaiSense Vita nRF52840"), |
8096 | 320 | ], |
321 | (0x239A, 0x0095): [ | |
9903 | 322 | ("UARTLOGBOOT", "UARTLogger II"), |
8096 | 323 | ], |
324 | (0x239A, 0x009F): [ | |
9903 | 325 | ("ADM840BOOT", "AtelierDuMaker NRF52840 Breakout"), |
8096 | 326 | ], |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
327 | (0x239A, 0x00A5): [ |
9903 | 328 | ("S3DKC1BOOT", "ESP32S3 DevKitC 1"), |
329 | ("S3DKM1BOOT", "ESP32S3 DevKitM 1"), | |
330 | ("SAOLA1RBOOT", "Saola 1R WROVER"), | |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
331 | ], |
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
332 | (0x239A, 0x00A7): [ |
9903 | 333 | ("SAOLA1MBOOT", "Saola 1M WROOM"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
334 | ], |
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
335 | (0x239A, 0x00AB): [ |
9903 | 336 | ("UFTHRS2BOOT", "FeatherS2"), |
337 | ], | |
338 | (0x239A, 0x00AD): [ | |
339 | ("TNSY41BOOT", "Teensy 4.1"), | |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
340 | ], |
8096 | 341 | (0x239A, 0x00AF): [ |
9903 | 342 | ("FLUFFBOOT", "Fluff M0"), |
8096 | 343 | ], |
344 | (0x239A, 0x00B3): [ | |
9903 | 345 | ("NICENANO", "nice!nano"), |
8096 | 346 | ], |
347 | (0x239A, 0x00B5): [ | |
9903 | 348 | ("E54XBOOT", "SAME54 Xplained"), |
8096 | 349 | ], |
350 | (0x239A, 0x00B9): [ | |
9903 | 351 | ("ND7BOOT", "ndBit7"), |
8096 | 352 | ], |
8919 | 353 | (0x239A, 0x00BB): [ |
9903 | 354 | ("MDBT50QBOOT", "Raytac MDBT50Q Demo Board 40"), |
8919 | 355 | ], |
8096 | 356 | (0x239A, 0x00BF): [ |
9903 | 357 | ("BADGEBOOT", "BLM Badge"), |
8096 | 358 | ], |
359 | (0x239A, 0x00C3): [ | |
9903 | 360 | ("GEMINIBOOT", "Gemini"), |
8096 | 361 | ], |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
362 | (0x239A, 0x00C5): [ |
9903 | 363 | ("MICROS2BOOT", "microS2"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
364 | ], |
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
365 | (0x239A, 0x00C7): [ |
9903 | 366 | ("KALUGA1BOOT", "Kaluga 1"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
367 | ], |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
368 | (0x239A, 0x00C9): [ |
9903 | 369 | ("MATRIXBOOT", "Matrix Portal M4"), |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
370 | ], |
8096 | 371 | (0x239A, 0x00CB): [ |
9903 | 372 | ("QTPY_BOOT", "QT Py M0"), |
8096 | 373 | ], |
374 | (0x239A, 0x00CD): [ | |
9903 | 375 | ("FTHRCANBOOT", "Feather M4 CAN Express"), |
8096 | 376 | ], |
10840 | 377 | (0x239A, 0x00D8): [ |
378 | ("NRF833BOOT", "Nordic nRF52833 DK"), | |
379 | ], | |
380 | (0x239A, 0x00DA): [ | |
381 | ("ARGONBOOT ", "Argon"), | |
382 | ("BORONBOOT ", "Boron"), | |
383 | ("XENONBOOT ", "Xenon"), | |
384 | ], | |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
385 | (0x239A, 0x00DE): [ |
9903 | 386 | ("NANOESPBOOT", "nanoESP32-S2 WROOM"), |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
387 | ], |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
388 | (0x239A, 0x00DF): [ |
9903 | 389 | ("METROS2BOOT", "Metro ESP32-S2"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
390 | ], |
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
391 | (0x239A, 0x00E1): [ |
9903 | 392 | ("METROM7BOOT", "Metro M7 iMX RT1011"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
393 | ], |
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
394 | (0x239A, 0x00E5): [ |
9903 | 395 | ("MAGTAGBOOT", "Metro MagTag 2.9 Grayscale"), |
396 | ("MAGTAGBOOT", "MagTag 2.9 Grayscale"), | |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
397 | ], |
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
398 | (0x239A, 0x00EB): [ |
9903 | 399 | ("FTHRS2BOOT", "Feather ESP32-S2"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
400 | ], |
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
401 | (0x239A, 0x00ED): [ |
9903 | 402 | ("FTHRS2BOOT", "Feather ESP32-S2 Reverse TFT"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
403 | ], |
8096 | 404 | (0x239A, 0x00EF): [ |
9903 | 405 | ("TRINKEYBOOT", "NeoPixel Trinkey M0"), |
8096 | 406 | ], |
407 | (0x239A, 0x00F5): [ | |
9903 | 408 | ("STARBOOT", "Binary Star"), |
8096 | 409 | ], |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
410 | (0x239A, 0x00F9): [ |
9903 | 411 | ("HOUSEBOOT", "FunHouse"), |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
412 | ], |
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
413 | (0x239A, 0x00FB): [ |
9903 | 414 | ("TRINKEYBOOT", "Rotary Trinkey M0"), |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
415 | ], |
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
416 | (0x239A, 0x00FF): [ |
9903 | 417 | ("TRINKEYBOOT", "NeoKey Trinkey M0"), |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
418 | ], |
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
419 | (0x239A, 0x0101): [ |
9903 | 420 | ("TRINKEYBOOT", "Slide Trinkey M0"), |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
421 | ], |
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
422 | (0x239A, 0x0103): [ |
9903 | 423 | ("TRINKEYBOOT", "ProxSense Trinkey M0"), |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
424 | ], |
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
425 | (0x239A, 0x010B): [ |
9903 | 426 | ("MDBT50QBOOT", "Raytac MDBT50Q-RX"), |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
427 | ], |
8919 | 428 | (0x239A, 0x010D): [ |
9903 | 429 | ("GLASSESBOOT", "LED Glasses Driver nRF52840"), |
8919 | 430 | ], |
431 | (0x239A, 0x010F): [ | |
9903 | 432 | ("FTHRS2BOOT", "Feather ESP32-S2 TFT"), |
8919 | 433 | ], |
434 | (0x239A, 0x0111): [ | |
9903 | 435 | ("QTPYS2BOOT", "QT Py ESP32-S2"), |
8919 | 436 | ], |
437 | (0x239A, 0x0115): [ | |
9903 | 438 | ("FEATHERBOOT", "Feather M4 Adalogger"), |
8919 | 439 | ], |
440 | (0x239A, 0x0117): [ | |
9903 | 441 | ("CAMERABOOT", "Camera"), |
10626 | 442 | ("CAMERABOOT", "PyCamera"), |
8919 | 443 | ], |
8956 | 444 | (0x239A, 0x0119): [ |
9903 | 445 | ("QTPYS3BOOT", "QT Py ESP32-S3"), |
8956 | 446 | ], |
10626 | 447 | (0x239A, 0x011B): [ |
448 | ("FTHRS3BOOT", "Feather ESP32-S3"), | |
449 | ], | |
9248 | 450 | (0x239A, 0x011D): [ |
9903 | 451 | ("FTHRS3BOOT", "Feather ESP32-S3 TFT"), |
9248 | 452 | ], |
9614 | 453 | (0x239A, 0x0123): [ |
9903 | 454 | ("FTHRS3BOOT", "Feather ESP32-S3 Reverse TFT"), |
9614 | 455 | ], |
456 | (0x239A, 0x0125): [ | |
9903 | 457 | ("MATRIXBOOT", "MatrixPortal ESP32-S2"), |
10112 | 458 | ("MATRXS3BOOT", "MatrixPortal S3"), |
459 | ], | |
460 | (0x239A, 0x0133): [ | |
461 | ("RT1050BOOT", "RT1050 EVK"), | |
462 | ], | |
463 | (0x239A, 0x0135): [ | |
464 | ("RT1040BOOT", "RT1040 EVK"), | |
10840 | 465 | ("TRINKEYBOOT", "SHT4x Trinkey M0"), |
10112 | 466 | ], |
467 | (0x239A, 0x0137): [ | |
468 | ("RT1015BOOT", "RT1015 EVK"), | |
469 | ], | |
470 | (0x239A, 0x013F): [ | |
471 | ("TOYS2BOOT", "My Little Hacker ESP32-S2"), | |
472 | ], | |
10626 | 473 | (0x239A, 0x0141): [ |
474 | ("METROM7BOOT", "Metro M7 iMX RT1011 SD"), | |
475 | ], | |
10112 | 476 | (0x239A, 0x0143): [ |
477 | ("QTPYS3BOOT", "QT Py ESP32-S3 (4M Flash, 2M PSRAM)"), | |
9614 | 478 | ], |
10626 | 479 | (0x239A, 0x0145): [ |
480 | ("METROS3BOOT", "Metro ESP32-S3"), | |
481 | ], | |
482 | (0x239A, 0x0147): [ | |
483 | ("TFT_S3BOOT", "Qualia ESP32-S3 RGB666"), | |
484 | ], | |
10840 | 485 | (0x239A, 0x0155): [ |
486 | ("TRINKEYBOOT", "Pixel Trinkey M0"), | |
487 | ], | |
488 | (0x239A, 0x0157): [ | |
489 | ("TRINKEYBOOT", "TRRS Trinkey M0"), | |
490 | ], | |
491 | (0x239A, 0x0159): [ | |
492 | ("TRINKEYBOOT", "Thumbstick Trinkey M0"), | |
493 | ], | |
494 | (0x239A, 0x015B): [ | |
495 | ("SPROUTBOOT", "SproutSense M0"), | |
496 | ], | |
497 | (0x239A, 0x015F): [ | |
498 | ("VNDS2BOOT", "Vindie S2"), | |
499 | ], | |
9614 | 500 | (0x239A, 0x2030): [ |
9903 | 501 | ("MBBOOT", "Maker badge"), |
9614 | 502 | ], |
10626 | 503 | (0x239A, 0x2031): [ |
504 | ("ES3inkBOOT", "ES3ink"), | |
505 | ], | |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
506 | (0x239A, 0x800B): [ |
9903 | 507 | ("ATMZBOOT", "ATMegaZero ESP32-S2"), |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
508 | ], |
8096 | 509 | (0x239A, 0xB000): [ |
9903 | 510 | ("HALLOWBOOT", "Hallowing M0"), |
8096 | 511 | ], |
512 | (0x239A, 0xE005): [ | |
9903 | 513 | ("HONKBOOT", "Big Honking Button"), |
8096 | 514 | ], |
515 | (0x2886, 0x000D): [ | |
9903 | 516 | ("Grove Zero", "Grove Zero"), |
8096 | 517 | ], |
11010 | 518 | (0x2886, 0x0010): [ |
519 | ("ARCHMIXBOOT", "RT1052 ARCH MIX"), | |
520 | ], | |
8096 | 521 | (0x2886, 0x002F): [ |
9903 | 522 | ("Seeed XIAO", "Seeeduino XIAO"), |
523 | ], | |
524 | (0x2886, 0x0044): [ | |
525 | ("XIAO-BOOT", "XIAO nRF52840"), | |
526 | ], | |
527 | (0x2886, 0x0045): [ | |
528 | ("XIAO-SENSE", "XIAO nRF52840"), | |
8096 | 529 | ], |
10902 | 530 | (0x2886, 0x0057): [ |
531 | ("T1000-E", "T1000-E for Meshtastic"), | |
532 | ], | |
10112 | 533 | (0x2886, 0x8056): [ |
534 | ("XIAOS3BOOT", "XIAO ESP32-S3"), | |
535 | ], | |
8096 | 536 | (0x2886, 0xF00E): [ |
9903 | 537 | ("PITAYAGO", "Pitaya Go"), |
8096 | 538 | ], |
539 | (0x2886, 0xF00F): [ | |
10626 | 540 | ("CONNECTKIT", "nRF52840 Connect Kit"), |
9903 | 541 | ("M60KEYBOARD", "MakerDiary M60 Mechanical Keyboard"), |
11010 | 542 | ("NANOKITBOOT", "iMX RT1011 Nano Kit"), |
9903 | 543 | ("nRF52840M2", "MakerDiary nRF52840 M.2 Module"), |
8096 | 544 | ], |
8919 | 545 | (0x303A, 0x7000): [ |
9903 | 546 | ("ESPHMI1BOOT", "HMI 1"), |
8919 | 547 | ], |
9614 | 548 | (0x303A, 0x7004): [ |
9903 | 549 | ("S3BOXBOOT", "ESP32S3 Box 2.5"), |
9614 | 550 | ], |
10626 | 551 | (0x303A, 0x7008): [ |
552 | ("S2DKC1BOOT", "ESP32S2 DevKitC 1"), | |
553 | ], | |
9614 | 554 | (0x303A, 0x700E): [ |
9903 | 555 | ("S3EYEBOOT", "ESP32S3 EYE"), |
9614 | 556 | ], |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
557 | (0x303A, 0x8005): [ |
9903 | 558 | ("TINYS2BOOT", "TinyS2"), |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
559 | ], |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
560 | (0x303A, 0x8008): [ |
9903 | 561 | ("TTGOS2BOOT", "TTGO_T8_S2_Display"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
562 | ], |
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
563 | (0x303A, 0x800E): [ |
9903 | 564 | ("CCMBRISBOOT", "CucumberRIS v1.1"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
565 | ], |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
566 | (0x303A, 0x80B0): [ |
9903 | 567 | ("RD00RBOOT", "Reference Design RD00"), |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
568 | ], |
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
569 | (0x303A, 0x80B3): [ |
9903 | 570 | ("NANOESPBOOT", "nanoESP32-S2 WROVER"), |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
571 | ], |
8919 | 572 | (0x303A, 0x80B5): [ |
9903 | 573 | ("FS2NEOBOOT", "FeatherS2 Neo"), |
8919 | 574 | ], |
575 | (0x303A, 0x80B6): [ | |
9903 | 576 | ("MORPHBOOT", "MORPHESP-240"), |
8919 | 577 | ], |
578 | (0x303A, 0x80C4): [ | |
9903 | 579 | ("S2MINIBOOT", "S2 Mini"), |
8919 | 580 | ], |
581 | (0x303A, 0x80C7): [ | |
9903 | 582 | ("S2PICOBOOT", "S2 Pico"), |
8919 | 583 | ], |
8956 | 584 | (0x303A, 0x80D2): [ |
9903 | 585 | ("TINYS3BOOT", "TinyS3"), |
8956 | 586 | ], |
587 | (0x303A, 0x80D5): [ | |
9903 | 588 | ("PROS3BOOT", "ProS3"), |
8956 | 589 | ], |
590 | (0x303A, 0x80D8): [ | |
9903 | 591 | ("UFTHRS3BOOT", "FeatherS3"), |
8956 | 592 | ], |
8919 | 593 | (0x303A, 0x80DA): [ |
9903 | 594 | ("HEXKYBOOT", "HexKy-S2"), |
8919 | 595 | ], |
10112 | 596 | (0x303A, 0x80DC): [ |
597 | ("ZEROS3BOOT", "ZeroS3"), | |
598 | ], | |
9051 | 599 | (0x303A, 0x80DE): [ |
9903 | 600 | ("LEAFS3BOOT", "BPI-Leaf-S3"), |
9051 | 601 | ], |
602 | (0x303A, 0x80E1): [ | |
9903 | 603 | ("LEAFS2BOOT", "BPI-Leaf-S2"), |
9051 | 604 | ], |
605 | (0x303A, 0x80E4): [ | |
9903 | 606 | ("BITS2BOOT", "BPI-BIT-S2"), |
9051 | 607 | ], |
608 | (0x303A, 0x80EB): [ | |
9903 | 609 | ("TTGOS2BOOT", "TTGO_T8_S2_WROOM"), |
9051 | 610 | ], |
611 | (0x303A, 0x80EE): [ | |
9903 | 612 | ("TTGOS2BOOT", "TTGO_T8_S2"), |
9051 | 613 | ], |
9614 | 614 | (0x303A, 0x80FA): [ |
9903 | 615 | ("MFAS3BOOT", "Maker Feather AIoT S3"), |
9614 | 616 | ], |
9248 | 617 | (0x303A, 0x8101): [ |
9903 | 618 | ("MMAINS2BOOT", "MiniMain ESP32-S2"), |
9248 | 619 | ], |
9614 | 620 | (0x303A, 0x8109): [ |
9903 | 621 | ("ESP32S2PICO", "ESP32-S2-Pico"), |
9614 | 622 | ], |
623 | (0x303A, 0x810B): [ | |
9903 | 624 | ("ESP32S2PICO", "ESP32-S2-Pico-LCD"), |
9614 | 625 | ], |
626 | (0x303A, 0x8112): [ | |
9903 | 627 | ("BEES3BOOT", "Bee S3"), |
9614 | 628 | ], |
629 | (0x303A, 0x8115): [ | |
9903 | 630 | ("BMS3BOOT", "Bee Motion S3"), |
9614 | 631 | ], |
632 | (0x303A, 0x8118): [ | |
9903 | 633 | ("LOLIN3BOOT", "S3"), |
9614 | 634 | ], |
10626 | 635 | (0x303A, 0x811A): [ |
636 | ("M5S3BOOT", "Stamp S3"), | |
637 | ], | |
10112 | 638 | (0x303A, 0x8121): [ |
639 | ("ATOMS3BOOT", "AtomS3"), | |
640 | ], | |
9614 | 641 | (0x303A, 0x812D): [ |
9903 | 642 | ("UF2BOOT", "BPI-PicoW-S3"), |
9614 | 643 | ], |
644 | (0x303A, 0x8134): [ | |
9903 | 645 | ("TBEAMBOOT", "T-Beam Supreme"), |
9614 | 646 | ], |
10112 | 647 | (0x303A, 0x8143): [ |
648 | ("DYMBOOT", "Deneyap Mini"), | |
649 | ], | |
650 | (0x303A, 0x8146): [ | |
651 | ("DYM2BOOT", "Deneyap Mini v2"), | |
652 | ], | |
653 | (0x303A, 0x8149): [ | |
654 | ("DY1A2BOOT", "Deneyap Kart 1A v2"), | |
655 | ], | |
656 | (0x303A, 0x8160): [ | |
657 | ("ATOMS3BOOT", "AtomS3 Lite"), | |
658 | ], | |
659 | (0x303A, 0x8165): [ | |
660 | ("YDESP32S3", "YD-ESP32-S3"), | |
661 | ], | |
10840 | 662 | (0x303A, 0x8169): [ |
663 | ("LOLIN3MBOOT", "S3Mini"), | |
664 | ], | |
10626 | 665 | (0x303A, 0x817B): [ |
666 | ("NANOS3BOOT", "NanoS3"), | |
667 | ], | |
668 | (0x303A, 0x8181): [ | |
669 | ("BLINGBOOT", "Bling!"), | |
670 | ], | |
671 | (0x303A, 0x8188): [ | |
672 | ("ATOMS3UBOOT", "AtomS3U"), | |
673 | ], | |
674 | (0x303A, 0x8191): [ | |
675 | ("TWRBOOT", "T-TWR Plus"), | |
676 | ], | |
677 | (0x303A, 0x81A1): [ | |
678 | ("HTBOOT", "Wireless Tracker"), | |
679 | ], | |
680 | (0x303A, 0x81A2): [ | |
681 | ("S3DKC1BOOT", "ESP32-S3-Pico"), | |
682 | ], | |
683 | (0x303A, 0x81AC): [ | |
684 | ("MAGICS3BOOT", "MagiClick S3"), | |
685 | ], | |
10902 | 686 | (0x303A, 0x81B2): [ |
687 | ("TWS3BOOT", "TinyWATCHS3"), | |
688 | ], | |
11010 | 689 | (0x303A, 0x81B3): [ |
690 | ("WS3ZEROBOOT", "ESP32-S3-Zero"), | |
691 | ], | |
10626 | 692 | (0x303A, 0x81BA): [ |
693 | ("senseBox", "MCU-S2 ESP32S2"), | |
694 | ], | |
10840 | 695 | (0x303A, 0x81FD): [ |
696 | ("UFTHS3NBOOT", "FeatherS3 Neo"), | |
697 | ], | |
10902 | 698 | (0x303A, 0x8200): [ |
699 | ("RGBTMBOOT", "RGB Touch Mini"), | |
700 | ], | |
701 | (0x303A, 0x821D): [ | |
702 | ("TWS3BOOT", "T-Watch-S3"), | |
703 | ], | |
704 | (0x303A, 0x8220): [ | |
705 | ("WSS3BOOT", "ESP32-S3-Touch-LCD-1.69"), | |
706 | ], | |
707 | (0x303A, 0x8223): [ | |
708 | ("WSS3BOOT", "ESP32-S3-LCD-1.69"), | |
709 | ], | |
710 | (0x303A, 0x8226): [ | |
711 | ("OMGS3BOOT", "OMGS3"), | |
712 | ], | |
9248 | 713 | (0x30A4, 0x0002): [ |
9903 | 714 | ("SWANBOOT", "Swan R5"), |
9248 | 715 | ], |
8096 | 716 | (0x3171, 0x0100): [ |
9903 | 717 | ("CMDBOOT", "COMMANDER"), |
8096 | 718 | ], |
10626 | 719 | (0x3343, 0x83CF): [ |
720 | ("FIRE2BOOT", "FireBeetle 2 ESP32-S3"), | |
721 | ], | |
8956 | 722 | (0x80E7, 0x8111): [ |
9903 | 723 | ("IOTS2BOOT", "HiiBot IoTs2"), |
8956 | 724 | ], |
10840 | 725 | (0xCAFE, 0xBABE): [ |
726 | ("CH32V2BOOT", "Dummy"), | |
727 | ], | |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
728 | (0xCAFE, 0xFFFF): [ |
9903 | 729 | ("F303BOOT", "STM32F303 Discovery"), |
8101
dee984e05647
UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8099
diff
changeset
|
730 | ], |
8096 | 731 | }, |
732 | "instructions": QCoreApplication.translate( | |
733 | "UF2FlashDialog", | |
734 | "<h3>CircuitPython Board</h3>" | |
735 | "<p>In order to prepare the board for flashing follow these" | |
736 | " steps:</p><ol>" | |
737 | "<li>Switch your device to 'bootloader' mode by double-pressing" | |
738 | " the reset button.</li>" | |
739 | "<li>Wait until the device has entered 'bootloader' mode.</li>" | |
740 | "<li>(If this does not happen, then try shorter or longer" | |
741 | " pauses between presses.)</li>" | |
742 | "<li>Ensure the boot volume is available (this may require" | |
743 | " mounting it).</li>" | |
744 | "<li>Select the firmware file to be flashed and click the" | |
745 | " flash button.</li>" | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
746 | "</ol>", |
8096 | 747 | ), |
8170
fb77bff32621
MicroPython: corrected a glitch in the UF2 flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8167
diff
changeset
|
748 | "show_all": True, |
8096 | 749 | "firmware": "CircuitPython", |
750 | }, | |
10897 | 751 | "rp2": { |
8111
a8e9b387f701
UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8101
diff
changeset
|
752 | "volumes": { |
a8e9b387f701
UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8101
diff
changeset
|
753 | (0x0000, 0x0000): [ |
9903 | 754 | ("RPI-RP2", "Raspberry Pi Pico"), # we don't have valid VID/PID |
10897 | 755 | ("RP2350", "Raspberry Pi Pico 2"), # we don't have valid VID/PID |
8111
a8e9b387f701
UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8101
diff
changeset
|
756 | ], |
a8e9b387f701
UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8101
diff
changeset
|
757 | }, |
8096 | 758 | "instructions": QCoreApplication.translate( |
759 | "UF2FlashDialog", | |
10897 | 760 | "<h3>Pi Pico (RP2040/RP2350) Board</h3>" |
8096 | 761 | "<p>In order to prepare the board for flashing follow these" |
762 | " steps:</p><ol>" | |
8167
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
763 | "<li>Enter 'bootloader' mode (board <b>without</b> RESET button):" |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
764 | "<ul>" |
8096 | 765 | "<li>Plug in your board while holding the BOOTSEL button.</li>" |
8167
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
766 | "</ul>" |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
767 | "Enter 'bootloader' mode (board <b>with</b> RESET button):" |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
768 | "<ul>" |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
769 | "<li>hold down RESET</li>" |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
770 | "<li>hold down BOOTSEL</li>" |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
771 | "<li>release RESET</li>" |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
772 | "<li>release BOOTSEL</li>" |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
773 | "</ul></li>" |
8096 | 774 | "<li>Wait until the device has entered 'bootloader' mode.</li>" |
775 | "<li>Ensure the boot volume is available (this may require" | |
776 | " mounting it).</li>" | |
777 | "<li>Select the firmware file to be flashed and click the" | |
778 | " flash button.</li>" | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
779 | "</ol>", |
8096 | 780 | ), |
8170
fb77bff32621
MicroPython: corrected a glitch in the UF2 flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8167
diff
changeset
|
781 | "show_all": True, |
8120
84928e9f446f
UF2FlashDialog: updated a string.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8111
diff
changeset
|
782 | "firmware": "MicroPython / CircuitPython", |
8096 | 783 | }, |
784 | } | |
785 | ||
786 | ||
787 | def getFoundDevices(boardType=""): | |
788 | """ | |
789 | Function to get the list of known serial devices supporting UF2. | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
790 | |
8096 | 791 | @param boardType specific board type to search for |
792 | @type str | |
793 | @return list of tuples with the board type, the port description, the | |
794 | VID and PID | |
9904
5d9a7d1afbd9
Changed the UF2 Dialog slightly to eliminate duplicate device entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9903
diff
changeset
|
795 | @rtype list of tuple of (str, str, (int, int)) |
8096 | 796 | """ |
9904
5d9a7d1afbd9
Changed the UF2 Dialog slightly to eliminate duplicate device entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9903
diff
changeset
|
797 | foundDevices = set() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
798 | |
9954 | 799 | # step 1: determine all known UF2 volumes that are mounted |
10253
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
800 | if not OSUtilities.isWindowsPlatform(): |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
801 | userMounts = FileSystemUtilities.getUserMounts() |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
802 | |
10373
093dcebe5ecb
Corrected some uses of dict.keys(), dict.values() and dict.items().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10370
diff
changeset
|
803 | boardTypes = [boardType] if boardType else list(SupportedUF2Boards) |
9954 | 804 | for board in boardTypes: |
805 | for vidpid, volumes in SupportedUF2Boards[board]["volumes"].items(): | |
806 | for volume, description in volumes: | |
10253
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
807 | if OSUtilities.isWindowsPlatform(): |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
808 | if FileSystemUtilities.findVolume(volume, findAll=True): |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
809 | foundDevices.add((board, description, vidpid)) |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
810 | else: |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
811 | # check only user mounted devices on non-Windows systems |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
812 | for userMount in userMounts: |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
813 | if os.path.basename(userMount).startswith(volume): |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
814 | foundDevices.add((board, description, vidpid)) |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
815 | break |
9954 | 816 | |
10253
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
817 | # step 2: determine all devices that have their UF2 volume not mounted |
8096 | 818 | availablePorts = QSerialPortInfo.availablePorts() |
819 | for port in availablePorts: | |
820 | vid = port.vendorIdentifier() | |
821 | pid = port.productIdentifier() | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
822 | |
8096 | 823 | if vid == 0 and pid == 0: |
824 | # no device detected at port | |
825 | continue | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
826 | |
8096 | 827 | for board in SupportedUF2Boards: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
828 | if (not boardType or (board.startswith(boardType))) and ( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
829 | vid, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
830 | pid, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
831 | ) in SupportedUF2Boards[board]["volumes"]: |
9954 | 832 | for device in foundDevices: |
833 | if (vid, pid) == device[2]: | |
834 | break | |
835 | else: | |
836 | foundDevices.add( | |
837 | ( | |
838 | board, | |
839 | port.description(), | |
840 | (vid, pid), | |
841 | ) | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
842 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
843 | |
10370
d84b074f772c
Fixed an issue in the MicroPython UF2 Flash dialog causing the wrong instructions being show in certain situations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10253
diff
changeset
|
844 | return [*foundDevices] |
8096 | 845 | |
846 | ||
847 | class UF2FlashDialog(QDialog, Ui_UF2FlashDialog): | |
848 | """ | |
849 | Class implementing a dialog to flash any UF2 capable device. | |
850 | """ | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
851 | |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8120
diff
changeset
|
852 | DeviceTypeRole = Qt.ItemDataRole.UserRole |
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8120
diff
changeset
|
853 | DeviceVidPidRole = Qt.ItemDataRole.UserRole + 1 |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
854 | |
8096 | 855 | def __init__(self, boardType="", parent=None): |
856 | """ | |
857 | Constructor | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
858 | |
8096 | 859 | @param boardType specific board type to show the dialog for |
860 | @type str | |
861 | @param parent reference to the parent widget (defaults to None) | |
862 | @type QWidget (optional) | |
863 | """ | |
8218
7c09585bd960
Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8170
diff
changeset
|
864 | super().__init__(parent) |
8096 | 865 | self.setupUi(self) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
866 | |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9248
diff
changeset
|
867 | self.refreshButton.setIcon(EricPixmapCache.getIcon("rescan")) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
868 | |
8356
68ec9c3d4de5
Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8327
diff
changeset
|
869 | self.firmwarePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
8096 | 870 | self.firmwarePicker.setFilters( |
9576
be9f8e7e42e0
Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9482
diff
changeset
|
871 | self.tr("MicroPython/CircuitPython Files (*.uf2);;All Files (*)") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
872 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
873 | |
8356
68ec9c3d4de5
Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8327
diff
changeset
|
874 | self.bootPicker.setMode(EricPathPickerModes.DIRECTORY_SHOW_FILES_MODE) |
8096 | 875 | self.bootPicker.setEnabled(False) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
876 | |
9815 | 877 | self.searchBootButton.setIcon(EricPixmapCache.getIcon("question")) |
878 | self.searchBootButton.setEnabled(False) | |
879 | ||
8096 | 880 | self.__mandatoryStyleSheet = ( |
8862
99459beb81b1
Adapted some style sheet usages to observe the palette lightness (dark/light).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
881 | "QLineEdit {border: 2px solid; border-color: #dd8888}" |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
882 | if ericApp().usesDarkPalette() |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
883 | else "QLineEdit {border: 2px solid; border-color: #800000}" |
8096 | 884 | ) |
885 | self.__manualType = "<manual>" | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
886 | |
8096 | 887 | self.__boardType = boardType |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
888 | |
10253
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
889 | self.on_refreshButton_clicked() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
890 | |
8096 | 891 | def __populate(self): |
892 | """ | |
893 | Private method to (re-)populate the dialog. | |
894 | """ | |
895 | # save the currently selected device | |
896 | currentDevice = self.devicesComboBox.currentText() | |
897 | firmwareFile = self.firmwarePicker.text() | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
898 | |
8096 | 899 | # clear the entries first |
900 | self.devicesComboBox.clear() | |
901 | self.firmwarePicker.clear() | |
902 | self.bootPicker.clear() | |
903 | self.infoLabel.clear() | |
904 | self.infoEdit.clear() | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
905 | |
8096 | 906 | # now populate the entries with data |
907 | devices = getFoundDevices(boardType=self.__boardType) | |
908 | if len(devices) == 0: | |
10370
d84b074f772c
Fixed an issue in the MicroPython UF2 Flash dialog causing the wrong instructions being show in certain situations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10253
diff
changeset
|
909 | # no device set yet |
d84b074f772c
Fixed an issue in the MicroPython UF2 Flash dialog causing the wrong instructions being show in certain situations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10253
diff
changeset
|
910 | devices = [ |
10373
093dcebe5ecb
Corrected some uses of dict.keys(), dict.values() and dict.items().
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10370
diff
changeset
|
911 | d for d in Devices.getFoundDevices()[0] if d[0] in SupportedUF2Boards |
10370
d84b074f772c
Fixed an issue in the MicroPython UF2 Flash dialog causing the wrong instructions being show in certain situations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10253
diff
changeset
|
912 | ] |
d84b074f772c
Fixed an issue in the MicroPython UF2 Flash dialog causing the wrong instructions being show in certain situations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10253
diff
changeset
|
913 | self.devicesComboBox.addItem("") |
d84b074f772c
Fixed an issue in the MicroPython UF2 Flash dialog causing the wrong instructions being show in certain situations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10253
diff
changeset
|
914 | self.devicesComboBox.addItem(self.tr("Manual Select")) |
d84b074f772c
Fixed an issue in the MicroPython UF2 Flash dialog causing the wrong instructions being show in certain situations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10253
diff
changeset
|
915 | self.devicesComboBox.setItemData( |
d84b074f772c
Fixed an issue in the MicroPython UF2 Flash dialog causing the wrong instructions being show in certain situations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10253
diff
changeset
|
916 | self.devicesComboBox.count() - 1, self.__manualType, self.DeviceTypeRole |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
917 | ) |
10370
d84b074f772c
Fixed an issue in the MicroPython UF2 Flash dialog causing the wrong instructions being show in certain situations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10253
diff
changeset
|
918 | self.on_devicesComboBox_currentIndexChanged(0) |
8096 | 919 | if devices: |
10370
d84b074f772c
Fixed an issue in the MicroPython UF2 Flash dialog causing the wrong instructions being show in certain situations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10253
diff
changeset
|
920 | self.__showSpecificInstructions(devices) |
8096 | 921 | else: |
922 | self.__showAllInstructions() | |
923 | elif len(devices) == 1: | |
8167
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
924 | # set the board type to the found one |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
925 | self.__boardType = devices[0][0] |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
926 | |
8096 | 927 | self.devicesComboBox.addItem(devices[0][1]) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
928 | self.devicesComboBox.setItemData(0, devices[0][0], self.DeviceTypeRole) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
929 | self.devicesComboBox.setItemData(0, devices[0][2], self.DeviceVidPidRole) |
8096 | 930 | self.devicesComboBox.addItem(self.tr("Manual Select")) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
931 | self.devicesComboBox.setItemData(1, self.__manualType, self.DeviceTypeRole) |
8096 | 932 | self.on_devicesComboBox_currentIndexChanged(0) |
933 | else: | |
9953
1aa8517bc61f
Enhanced the UF2 flash dialog slightly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9904
diff
changeset
|
934 | for index, (boardType, description, vidpid) in enumerate(sorted(devices)): |
8096 | 935 | self.devicesComboBox.addItem(description) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
936 | self.devicesComboBox.setItemData(index, boardType, self.DeviceTypeRole) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
937 | self.devicesComboBox.setItemData(index, vidpid, self.DeviceVidPidRole) |
8096 | 938 | self.devicesComboBox.addItem(self.tr("Manual Select")) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
939 | self.devicesComboBox.setItemData( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
940 | index + 1, self.__manualType, self.DeviceTypeRole |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
941 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
942 | |
9953
1aa8517bc61f
Enhanced the UF2 flash dialog slightly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9904
diff
changeset
|
943 | # select the remembered device, if it is still there |
8096 | 944 | if currentDevice: |
945 | self.devicesComboBox.setCurrentText(currentDevice) | |
9954 | 946 | if self.devicesComboBox.currentIndex() == -1 and len(devices) == 1: |
947 | # the device name has changed but only one is present; select it | |
948 | self.devicesComboBox.setCurrentIndex(0) | |
8096 | 949 | self.firmwarePicker.setText(firmwareFile) |
9953
1aa8517bc61f
Enhanced the UF2 flash dialog slightly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9904
diff
changeset
|
950 | elif len(devices) == 1: |
1aa8517bc61f
Enhanced the UF2 flash dialog slightly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9904
diff
changeset
|
951 | self.devicesComboBox.setCurrentIndex(0) |
8096 | 952 | else: |
9953
1aa8517bc61f
Enhanced the UF2 flash dialog slightly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9904
diff
changeset
|
953 | self.devicesComboBox.setCurrentIndex(-1) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
954 | |
8096 | 955 | def __updateFlashButton(self): |
956 | """ | |
957 | Private method to update the state of the Flash button and the retest | |
958 | button. | |
959 | """ | |
960 | firmwareFile = self.firmwarePicker.text() | |
961 | if self.devicesComboBox.currentData(self.DeviceTypeRole) is not None: | |
962 | if bool(firmwareFile) and os.path.exists(firmwareFile): | |
963 | self.firmwarePicker.setStyleSheet("") | |
964 | else: | |
965 | self.firmwarePicker.setStyleSheet(self.__mandatoryStyleSheet) | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
966 | |
8096 | 967 | if bool(self.bootPicker.text()): |
968 | self.bootPicker.setStyleSheet("") | |
969 | else: | |
970 | self.bootPicker.setStyleSheet(self.__mandatoryStyleSheet) | |
971 | else: | |
972 | self.firmwarePicker.setStyleSheet("") | |
973 | self.bootPicker.setStyleSheet("") | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
974 | |
8096 | 975 | enable = ( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
976 | bool(self.bootPicker.text()) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
977 | and bool(firmwareFile) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
978 | and os.path.exists(firmwareFile) |
8096 | 979 | ) |
980 | self.flashButton.setEnabled(enable) | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
981 | |
8096 | 982 | def __showAllInstructions(self): |
983 | """ | |
984 | Private method to show instructions for resetting devices to bootloader | |
985 | mode. | |
986 | """ | |
987 | self.infoLabel.setText(self.tr("Reset Instructions:")) | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
988 | |
8096 | 989 | htmlText = self.tr( |
990 | "<h4>No known devices detected.</h4>" | |
991 | "<p>Follow the appropriate instructions below to set <b>one</b>" | |
992 | " board into 'bootloader' mode. Press <b>Refresh</b> when ready." | |
993 | "</p>" | |
994 | ) | |
995 | for boardType in SupportedUF2Boards: | |
8170
fb77bff32621
MicroPython: corrected a glitch in the UF2 flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8167
diff
changeset
|
996 | if SupportedUF2Boards[boardType]["show_all"]: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
997 | htmlText += "<hr/>" + SupportedUF2Boards[boardType]["instructions"] |
8096 | 998 | self.infoEdit.setHtml(htmlText) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
999 | |
8096 | 1000 | def __showSpecificInstructions(self, devices): |
1001 | """ | |
1002 | Private method to show instructions for resetting devices to bootloader | |
1003 | mode for a list of detected devices. | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1004 | |
8096 | 1005 | @param devices list of detected devices |
1006 | @type list of str | |
1007 | """ | |
8099
522946e53835
Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8097
diff
changeset
|
1008 | boardTypes = {x[0] for x in devices} |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1009 | |
8096 | 1010 | self.infoLabel.setText(self.tr("Reset Instructions:")) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1011 | |
8096 | 1012 | if self.__boardType: |
1013 | htmlText = self.tr( | |
1014 | "<h4>Flash {0} Firmware</h4>" | |
1015 | "<p>Follow the instructions below to set <b>one</b> board into" | |
1016 | " 'bootloader' mode. Press <b>Refresh</b> when ready.</p>" | |
1017 | "<hr/>{1}" | |
1018 | ).format( | |
1019 | SupportedUF2Boards[self.__boardType]["firmware"], | |
1020 | SupportedUF2Boards[self.__boardType]["instructions"], | |
1021 | ) | |
1022 | else: | |
1023 | htmlText = self.tr( | |
1024 | "<h4>Potentially UF2 capable devices found</h4>" | |
1025 | "<p>Found these potentially UF2 capable devices:</p>" | |
1026 | "<ul><li>{0}</li></ul>" | |
1027 | "<p>Follow the instructions below to set <b>one</b> board into" | |
1028 | " 'bootloader' mode. Press <b>Refresh</b> when ready.</p>" | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1029 | ).format("</li><li>".join(sorted(x[1] for x in devices))) |
8096 | 1030 | for boardType in sorted(boardTypes): |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1031 | htmlText += "<hr/>" + SupportedUF2Boards[boardType]["instructions"] |
8096 | 1032 | self.infoEdit.setHtml(htmlText) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1033 | |
8096 | 1034 | def __showTypedInstructions(self, boardType): |
1035 | """ | |
1036 | Private method to show instructions for resetting devices to bootloader | |
1037 | mode for a specific board type. | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1038 | |
8096 | 1039 | @param boardType type of the board to show instructions for |
1040 | @type str | |
1041 | """ | |
1042 | self.infoLabel.setText(self.tr("Reset Instructions:")) | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1043 | |
8096 | 1044 | htmlText = self.tr( |
1045 | "<h4>No known devices detected.</h4>" | |
1046 | "<p>Follow the instructions below to set <b>one</b> board into" | |
1047 | " 'bootloader' mode. Press <b>Refresh</b> when ready.</p>" | |
1048 | ) | |
1049 | htmlText += "<hr/>" + SupportedUF2Boards[boardType]["instructions"] | |
1050 | self.infoEdit.setHtml(htmlText) | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1051 | |
8096 | 1052 | def __showManualInstructions(self): |
1053 | """ | |
1054 | Private method to show instructions for flashing devices manually. | |
1055 | """ | |
1056 | self.infoLabel.setText(self.tr("Flash Instructions:")) | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1057 | |
8096 | 1058 | htmlText = self.tr( |
1059 | "<h4>Flash method 'manual' selected.</h4>" | |
1060 | "<p>Follow the instructions below to flash a device by entering" | |
8097
5af9c426c46b
Updated translations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
1061 | " the data manually.</p><ol>" |
8096 | 1062 | "<li>Change the device to 'bootloader' mode.</li>" |
1063 | "<li>Wait until the device has entered 'bootloader' mode.</li>" | |
1064 | "<li>Ensure the boot volume is available (this may require" | |
1065 | " mounting it) and select its path.</li>" | |
1066 | "<li>Select the firmware file to be flashed and click the" | |
1067 | " flash button.</li>" | |
1068 | "</ol>" | |
1069 | ) | |
1070 | for boardType in SupportedUF2Boards: | |
1071 | htmlText += "<hr/>" + SupportedUF2Boards[boardType]["instructions"] | |
1072 | self.infoEdit.setHtml(htmlText) | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1073 | |
8167
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
1074 | def __showNoVolumeInformation(self, volumes, boardType): |
8096 | 1075 | """ |
1076 | Private method to show information about the expected boot volume(s). | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1077 | |
8096 | 1078 | @param volumes list of expected volume names |
1079 | @type list of str | |
8167
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
1080 | @param boardType type of the board to show instructions for |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
1081 | @type str |
8096 | 1082 | """ |
1083 | self.infoLabel.setText(self.tr("Boot Volume not found:")) | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1084 | |
8096 | 1085 | htmlText = self.tr( |
1086 | "<h4>No Boot Volume detected.</h4>" | |
1087 | "<p>Please ensure that the boot volume of the device to be flashed" | |
1088 | " is available. " | |
1089 | ) | |
1090 | if len(volumes) == 1: | |
1091 | htmlText += self.tr( | |
1092 | "This volume should be named <b>{0}</b>." | |
1093 | " Press <b>Refresh</b> when ready.</p>" | |
1094 | ).format(volumes[0]) | |
1095 | else: | |
1096 | htmlText += self.tr( | |
1097 | "This volume should have one of these names.</p>" | |
1098 | "<ul><li>{0}</li></ul>" | |
1099 | "<p>Press <b>Refresh</b> when ready.</p>" | |
1100 | ).format("</li><li>".join(sorted(volumes))) | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1101 | |
8167
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
1102 | if boardType: |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
1103 | htmlText += self.tr( |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
1104 | "<h4>Reset Instructions</h4>" |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
1105 | "<p>Follow the instructions below to set the board into" |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
1106 | " 'bootloader' mode. Press <b>Refresh</b> when ready.</p>" |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
1107 | ) |
cdc1b6692766
MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
1108 | htmlText += "<hr/>" + SupportedUF2Boards[boardType]["instructions"] |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1109 | |
8096 | 1110 | self.infoEdit.setHtml(htmlText) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1111 | |
8096 | 1112 | def __showMultipleVolumesInformation(self, volumePaths): |
1113 | """ | |
1114 | Private method to show information because multiple devices of the | |
1115 | same type are ready for flashing. | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1116 | |
8096 | 1117 | Note: This is a dangerous situation! |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1118 | |
8096 | 1119 | @param volumePaths list of volume paths |
1120 | @type list of str | |
1121 | """ | |
1122 | self.infoLabel.setText(self.tr("Multiple Boot Volumes found:")) | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1123 | |
8096 | 1124 | htmlText = self.tr( |
1125 | "<h4>Multiple Boot Volumes were found</h4>" | |
1126 | "<p>These volume paths were found.</p><ul><li>{0}</li></ul>" | |
1127 | "<p>Please ensure that only one device of a type is ready for" | |
1128 | " flashing. Press <b>Refresh</b> when ready.</p>" | |
1129 | ).format("</li><li>".join(sorted(volumePaths))) | |
1130 | self.infoEdit.setHtml(htmlText) | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1131 | |
8096 | 1132 | @pyqtSlot() |
1133 | def on_flashButton_clicked(self): | |
1134 | """ | |
1135 | Private slot to flash the selected MicroPython or CircuitPython | |
1136 | firmware onto the device. | |
1137 | """ | |
1138 | boardType = self.devicesComboBox.currentData(self.DeviceTypeRole) | |
1139 | firmwarePath = self.firmwarePicker.text() | |
1140 | volumePath = self.bootPicker.text() | |
1141 | if os.path.exists(firmwarePath) and os.path.exists(volumePath): | |
8111
a8e9b387f701
UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8101
diff
changeset
|
1142 | if boardType == self.__manualType: |
a8e9b387f701
UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8101
diff
changeset
|
1143 | self.infoLabel.setText(self.tr("Flashing Firmware")) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1144 | self.infoEdit.setHtml( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1145 | self.tr( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1146 | "<p>Flashing the selected firmware to the device. Please" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1147 | " wait until the device resets automatically.</p>" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1148 | ) |
8111
a8e9b387f701
UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8101
diff
changeset
|
1149 | ) |
a8e9b387f701
UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8101
diff
changeset
|
1150 | else: |
a8e9b387f701
UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8101
diff
changeset
|
1151 | firmwareType = SupportedUF2Boards[boardType]["firmware"] |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1152 | self.infoLabel.setText(self.tr("Flashing {0}").format(firmwareType)) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1153 | self.infoEdit.setHtml( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1154 | self.tr( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1155 | "<p>Flashing the {0} firmware to the device. Please wait" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1156 | " until the device resets automatically.</p>" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1157 | ).format(firmwareType) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1158 | ) |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8120
diff
changeset
|
1159 | QCoreApplication.processEvents( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1160 | QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1161 | ) |
10172 | 1162 | with contextlib.suppress(FileNotFoundError): |
1163 | shutil.copy(firmwarePath, volumePath) | |
8096 | 1164 | QThread.sleep(1) |
1165 | self.on_refreshButton_clicked() | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1166 | |
8096 | 1167 | @pyqtSlot() |
1168 | def on_refreshButton_clicked(self): | |
1169 | """ | |
1170 | Private slot to refresh the dialog. | |
1171 | """ | |
1172 | self.__populate() | |
9954 | 1173 | self.__updateFlashButton() |
10253
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
1174 | self.on_devicesComboBox_currentIndexChanged(0) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1175 | |
8096 | 1176 | @pyqtSlot(int) |
1177 | def on_devicesComboBox_currentIndexChanged(self, index): | |
1178 | """ | |
1179 | Private slot to handle the selection of a board. | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1180 | |
8096 | 1181 | @param index selected index |
1182 | @type int | |
1183 | """ | |
1184 | vidpid = self.devicesComboBox.itemData(index, self.DeviceVidPidRole) | |
1185 | boardType = self.devicesComboBox.itemData(index, self.DeviceTypeRole) | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1186 | |
9815 | 1187 | self.searchBootButton.setEnabled(boardType == self.__manualType) |
8096 | 1188 | self.bootPicker.setEnabled(boardType == self.__manualType) |
1189 | if boardType == self.__manualType: | |
1190 | self.__showManualInstructions() | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1191 | |
8096 | 1192 | if vidpid is None: |
1193 | if boardType is None: | |
1194 | self.bootPicker.clear() | |
1195 | else: | |
1196 | volumes = SupportedUF2Boards[boardType]["volumes"][vidpid] | |
1197 | foundVolumes = [] | |
9903 | 1198 | for volume, _ in volumes: |
9624
b47dfa7a137d
Refactored the Utilities and Globals modules in order to enhance the maintainability.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9614
diff
changeset
|
1199 | foundVolumes += FileSystemUtilities.findVolume(volume, findAll=True) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1200 | |
8096 | 1201 | if len(foundVolumes) == 0: |
9903 | 1202 | self.__showNoVolumeInformation([v[0] for v in volumes], boardType) |
8096 | 1203 | self.bootPicker.clear() |
1204 | elif len(foundVolumes) == 1: | |
1205 | self.bootPicker.setText(foundVolumes[0]) | |
1206 | else: | |
9954 | 1207 | self.__showMultipleVolumesInformation(foundVolumes) |
8096 | 1208 | self.bootPicker.clear() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1209 | |
8096 | 1210 | self.__updateFlashButton() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1211 | |
8096 | 1212 | @pyqtSlot(str) |
1213 | def on_firmwarePicker_textChanged(self, text): | |
1214 | """ | |
1215 | Private slot handling a change of the firmware file. | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1216 | |
8096 | 1217 | @param text current text of the firmware edit |
1218 | @type str | |
1219 | """ | |
1220 | self.__updateFlashButton() | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1221 | |
8096 | 1222 | @pyqtSlot(str) |
1223 | def on_bootPicker_textChanged(self, text): | |
1224 | """ | |
1225 | Private slot handling a change of the boot volume. | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
1226 | |
8096 | 1227 | @param text current text of the boot volume edit |
1228 | @type str | |
1229 | """ | |
1230 | self.__updateFlashButton() | |
9815 | 1231 | |
1232 | @pyqtSlot() | |
1233 | def on_searchBootButton_clicked(self): | |
1234 | """ | |
1235 | Private slot to look for all known boot paths and present a list to select from. | |
1236 | """ | |
1237 | foundBootVolumes = set() | |
10253
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
1238 | if not OSUtilities.isWindowsPlatform(): |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
1239 | userMounts = FileSystemUtilities.getUserMounts() |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
1240 | |
9815 | 1241 | for boardType in SupportedUF2Boards: |
1242 | for volumes in SupportedUF2Boards[boardType]["volumes"].values(): | |
9903 | 1243 | for volume, _ in volumes: |
10253
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
1244 | if OSUtilities.isWindowsPlatform(): |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
1245 | foundBootVolumes.update( |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
1246 | FileSystemUtilities.findVolume(volume, findAll=True) |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
1247 | ) |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
1248 | else: |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
1249 | # check only user mounted devices on non-Windows systems |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
1250 | for userMount in userMounts: |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
1251 | if os.path.basename(userMount).startswith(volume): |
f9a0704d16b2
MicroPython interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10208
diff
changeset
|
1252 | foundBootVolumes.add(userMount) |
9815 | 1253 | |
1254 | if len(foundBootVolumes) == 0: | |
1255 | selectedVolume = "" | |
9903 | 1256 | EricMessageBox.information( |
1257 | self, | |
1258 | self.tr("Flash UF2 Device"), | |
1259 | self.tr("""No UF2 device 'boot' volumes found."""), | |
1260 | ) | |
9815 | 1261 | elif len(foundBootVolumes) == 1: |
10370
d84b074f772c
Fixed an issue in the MicroPython UF2 Flash dialog causing the wrong instructions being show in certain situations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10253
diff
changeset
|
1262 | selectedVolume = [*foundBootVolumes][0] |
9815 | 1263 | else: |
1264 | result, ok = QInputDialog.getItem( | |
9903 | 1265 | self, |
9815 | 1266 | QCoreApplication.translate("UF2FlashDialog", "Flash UF2 Device"), |
1267 | QCoreApplication.translate( | |
1268 | "UF2FlashDialog", "Select the Boot Volume of the device:" | |
1269 | ), | |
10370
d84b074f772c
Fixed an issue in the MicroPython UF2 Flash dialog causing the wrong instructions being show in certain situations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10253
diff
changeset
|
1270 | [*foundBootVolumes], |
9821
6b1b06d74532
Fixed some code formatting issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9815
diff
changeset
|
1271 | 0, |
6b1b06d74532
Fixed some code formatting issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9815
diff
changeset
|
1272 | True, |
9815 | 1273 | ) |
1274 | selectedVolume = result if ok else "" | |
1275 | ||
1276 | self.bootPicker.setText(selectedVolume) |