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