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