eric6/MicroPython/UF2FlashDialog.py

Sun, 21 Mar 2021 18:00:30 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 21 Mar 2021 18:00:30 +0100
changeset 8167
cdc1b6692766
parent 8143
2c730d5fd177
child 8170
fb77bff32621
permissions
-rw-r--r--

MicroPython: improved the UF2 Flash dialog.

8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3 # Copyright (c) 2021 Detlev Offenbach <detlev@die-offenbachs.de>
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to flash any UF2 capable device.
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 import os
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 import shutil
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from PyQt5.QtCore import pyqtSlot, Qt, QCoreApplication, QThread, QEventLoop
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 from PyQt5.QtWidgets import QDialog
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 from E5Gui.E5PathPicker import E5PathPickerModes
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 from .Ui_UF2FlashDialog import Ui_UF2FlashDialog
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 import UI.PixmapCache
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 import Utilities
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 from . import MicroPythonDevices
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 SupportedUF2Boards = {
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 "circuitpython": {
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 "volumes": {
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 (0x03EB, 0x2402): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 "SAMD21", # SAMD21 Board
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 "SAME54", # SAME54 Board
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 (0x04D8, 0xEC44): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 "PYCUBEDBOOT", # PyCubedv04
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 (0x04D8, 0xEC63): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 "BOOT", # CircuitBrains Basic
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 (0x04D8, 0xEC64): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 "BOOT", # CircuitBrains Deluxe
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 (0x04D8, 0xED5F): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 "UCHIPYBOOT", # uChip CircuitPython
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 (0x04D8, 0xEDB3): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 "USBHUBBOOT", # Programmable USB Hub
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 (0x04D8, 0xEDBE): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 "SAM32BOOT", # SAM32
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 (0x04D8, 0xEF66): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 "SENSEBOX", # senseBox MCU
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 (0x1209, 0x2017): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 "MINISAMBOOT", # Mini SAM M4
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 ],
8101
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
56 (0x1209, 0x3252): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
57 "MCBS2OMBOOT", # Module Clip w/Wroom
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
58 ],
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
59 (0x1209, 0x3253): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
60 "MCBS2ERBOOT", # Module Clip w/Wrover
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
61 ],
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 (0x1209, 0x4D44): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 "ROBOM0BOOT", # Robo HAT MM1
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 "ROBOM4BOOT", # Robo HAT MM1 M4
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 (0x1209, 0x4DDD): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 "SapBOOT", # CP Sapling
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 (0x1209, 0x7102): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 "MINISAMBOOT", # Mini SAM M0
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 (0x1209, 0x805A): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 "BASTBLE", # Bast BLE
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 (0x1209, 0xE3E2): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 "StackRduino", # StackRduino M0 PRO
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 (0x1209, 0xF501): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 "M4SHIMBOOT", # M4-Shim
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 ],
8101
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
81 (0x15BA, 0x28DC): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
82 "OLMLIPOBOOT", # ESP32S2 DevKit Lipo
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
83 ],
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 (0x16D0, 0x0CDA): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 "AUTOMAT", # automat
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 (0x1B4F, 0x0019): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 "QwiicMicro", # Sparkfun Qwiic Micro
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 (0x1B4F, 0x0D22): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 "SPARKFUN", # Sparkfun SAMD21 Mini Breakout
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 (0x1B4F, 0x0D23): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 "SPARKFUN", # Sparkfun SAMD21 Dev Breakout
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 (0x1D50, 0x6110): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 "ROBOTICS", # Robotics
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 (0x1D50, 0x6112): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 "RCBOOT", # Wattuino RC
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 (0x1D50, 0x6160): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 "BLUEMICRO", # BlueMicro
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 ],
8101
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
105 (0x1FC9, 0x0094): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
106 "DblM33BOOT", # Double M33
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
107 "LPC5528BOOT", # LPCXpresso 55s28
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
108 "LPC5569BOOT", # LPCXpresso 55s69
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
109 ],
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 (0x230A, 0x00E9): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 "TAU_BOOT", # Tau
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 (0x2341, 0x0057): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 "NANOBOOT", # NANO 33 IoT
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 (0x2341, 0x8053): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 "MKR1300", # MKR1300
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 (0x239A, 0x000F): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 "ITSYBOOT", # ItsyBitsy M0 Express
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 (0x239A, 0x0013): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 "METROBOOT", # Metro M0
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 (0x239A, 0x0015): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 "FEATHERBOOT", # Feather M0
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 (0x239A, 0x0018): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 "CPLAYBOOT", # CPlay Express
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 (0x239A, 0x001B): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 "FEATHERBOOT", # Feather M0 Express
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 (0x239A, 0x001C): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 "GEMMABOOT", # Gemma M0
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 (0x239A, 0x001E): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 "TRINKETBOOT", # Trinket M0
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 (0x239A, 0x0021): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 "METROM4BOOT", # Metro M4 Express
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 (0x239A, 0x0022): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 "ARCADE-D5", # Feather Arcade D51
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 "FEATHERBOOT", # Feather M4 Express
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 (0x239A, 0x0024): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 "RADIOBOOT", # Radiofruit M0
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 (0x239A, 0x0027): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 "PIRKEYBOOT", # pIRKey M0
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 (0x239A, 0x0029): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 "ARGONBOOT ", # Argon
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 "BORONBOOT ", # Boron
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156 "FTHR840BOOT", # Feather nRF52840 Express
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 "MDBT50QBOOT", # Raytac MDBT50Q-RX
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 "MDK840DONGL", # MDK nRF52840 USB Dongle
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 "WS52840EVK", # Waveshare nRF52840 Eval
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 "XENONBOOT ", # Xenon
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 (0x239A, 0x002B): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 "ARCADE-D5", # Itsy Arcade D51
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 "ITSYM4BOOT", # ItsyBitsy M4 Express
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 (0x239A, 0x002D): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 "CRICKITBOOT", # crickit
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 (0x239A, 0x002F): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 "TRELM4BOOT", # Trellis M4 Express
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 (0x239A, 0x0031): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 "GCM4BOOT", # Grand Central M4 Express
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 (0x239A, 0x0033): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 "PYBADGEBOOT", # PyBadge
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 (0x239A, 0x0034): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 "BADGELCBOOT", # BadgeLC
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180 "PEWBOOT", # PewPew
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 (0x239A, 0x0035): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 "MKRZEROBOOT", # MKRZero
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 "PORTALBOOT", # PyPortal M4 Express
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 (0x239A, 0x0037): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187 "METROM4BOOT", # Metro M4 AirLift
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 (0x239A, 0x003D): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 "PYGAMERBOOT", # PyGamer
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 (0x239A, 0x003F): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 "METR840BOOT", # Metro nRF52840 Express
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 (0x239A, 0x0045): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 "CPLAYBTBOOT", # Circuit Playground nRF52840
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 (0x239A, 0x0047): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199 "MASKM4BOOT", # Hallowing Mask M4
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 (0x239A, 0x0049): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 "HALLOM4BOOT", # HalloWing M4
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 (0x239A, 0x004D): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205 "SNEKBOOT", # snekboard
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207 (0x239A, 0x0051): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 "ITSY840BOOT", # ItsyBitsy nRF52840 Express
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 (0x239A, 0x0057): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 "SERPENTBOOT", # Serpente
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212 ],
8101
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
213 (0x239A, 0x0059): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
214 "FTHR405BOOT", # Feather STM32F405 Express
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
215 ],
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
216 (0x239A, 0x005D): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
217 "BlackPill", # STM32F401CxUx
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
218 "STMF411BOOT", # STM32F411 Discovery
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
219 ],
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 (0x239A, 0x0061): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221 "SOLBOOT", # Sol
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223 (0x239A, 0x0063): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 "NANO33BOOT", # Nano 33 BLE
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 (0x239A, 0x0065): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 "ND6BOOT", # ndBit6
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 (0x239A, 0x006B): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 "shIRtty", # shIRtty
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 (0x239A, 0x0071): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233 "CLUEBOOT", # CLUE nRF52840
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 ],
8101
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
235 (0x239A, 0x0077): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
236 "RT1010BOOT", # RT1010 EVK
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
237 ],
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 (0x239A, 0x0079): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 "ARAMBOOT", # ARAMCON Badge 2019
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241 (0x239A, 0x007D): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242 "BOOKBOOT", # The Open Book Feather
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 (0x239A, 0x007F): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 "BADGEBOOT", # OHS2020 Badge
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246 ],
8101
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
247 (0x239A, 0x0081): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
248 "RT1020BOOT", # RT1020 EVK
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
249 ],
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
250 (0x239A, 0x0083): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
251 "RT1060BOOT", # RT1060 EVK
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
252 ],
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
253 (0x239A, 0x0087): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
254 "FTHRSNSBOOT", # Feather nRF52840 Sense
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
255 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256 (0x239A, 0x0093): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
257 "ISVITABoot", # IkigaiSense Vita nRF52840
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
258 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
259 (0x239A, 0x0095): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
260 "UARTLOGBOOT", # UARTLogger II
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 (0x239A, 0x009F): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263 "ADM840BOOT", # AtelierDuMaker NRF52840 Breakout
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 ],
8101
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
265 (0x239A, 0x00A5): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
266 "SAOLA1RBOOT", # Saola 1R WROVER
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
267 ],
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
268 (0x239A, 0x00A7): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
269 "SAOLA1MBOOT", # Saola 1M WROOM
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
270 ],
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
271 (0x239A, 0x00AB): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
272 "UFTHRS2BOOT", # FeatherS2
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
273 ],
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 (0x239A, 0x00AF): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 "FLUFFBOOT", # Fluff M0
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277 (0x239A, 0x00B3): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 "NICENANO", # nice!nano
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 (0x239A, 0x00B5): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 "E54XBOOT", # SAME54 Xplained
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 (0x239A, 0x00B9): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284 "ND7BOOT", # ndBit7
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
286 (0x239A, 0x00BF): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
287 "BADGEBOOT", # BLM Badge
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
288 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 (0x239A, 0x00C3): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 "GEMINIBOOT", # Gemini
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291 ],
8101
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
292 (0x239A, 0x00C5): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
293 "MICROS2BOOT", # microS2
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
294 ],
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
295 (0x239A, 0x00C7): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
296 "KALUGA1BOOT", # Kaluga 1
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
297 ],
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298 (0x239A, 0x00CB): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
299 "QTPY_BOOT", # QT Py M0
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 (0x239A, 0x00CD): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 "FTHRCANBOOT", # Feather M4 CAN Express
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 ],
8101
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
304 (0x239A, 0x00DF): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
305 "METROS2BOOT", # Metro ESP32-S2
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
306 ],
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
307 (0x239A, 0x00E1): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
308 "METROM7BOOT", # Metro M7 1011
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
309 ],
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
310 (0x239A, 0x00E5): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
311 "MAGTAGBOOT", # Metro MagTag 2.9 Grayscale
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
312 ],
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
313 (0x239A, 0x00EB): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
314 "FTHRS2BOOT", # Feather ESP32-S2
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, 0x00ED): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
317 "FTHRS2BOOT", # Feather ESP32-S2 Reverse TFT
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
318 ],
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
319 (0x239A, 0x00EF): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320 "TRINKEYBOOT", # NeoPixel Trinkey M0
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 (0x239A, 0x00F5): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 "STARBOOT", # Binary Star
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 (0x239A, 0xB000): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326 "HALLOWBOOT", # Hallowing M0
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328 (0x239A, 0xE005): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
329 "HONKBOOT", # Big Honking Button
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
330 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331 (0x2886, 0x000D): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332 "Grove Zero", # Grove Zero
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
333 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
334 (0x2886, 0x002F): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 "Seeed XIAO", # Seeeduino XIAO
8101
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
336 "Arduino", # Seeeduino XIAO (old bootloader)
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
337 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
338 (0x2886, 0xF00E): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 "PITAYAGO", # Pitaya Go
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340 ],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341 (0x2886, 0xF00F): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
342 "nRF52840M2", # MakerDiary nRF52840 M.2 Module
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 ],
8101
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
344 (0x303A, 0x8008): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
345 "TTGOS2BOOT", # TTGO_T8_S2_Display
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
346 ],
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
347 (0x303A, 0x800E): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
348 "CCMBRISBOOT", # CucumberRIS v1.1
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
349 ],
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
350 (0x3171, 0x0100): [
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 "CMDBOOT", # COMMANDER
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 ],
8101
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
353 (0xCAFE, 0xFFFF): [
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
354 "F303BOOT", # STM32F303 Discovery
dee984e05647 UF2FlashDialog: extended the list of known UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8099
diff changeset
355 ],
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356 },
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
357 "instructions": QCoreApplication.translate(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358 "UF2FlashDialog",
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 "<h3>CircuitPython Board</h3>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 "<p>In order to prepare the board for flashing follow these"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361 " steps:</p><ol>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 "<li>Switch your device to 'bootloader' mode by double-pressing"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363 " the reset button.</li>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
364 "<li>Wait until the device has entered 'bootloader' mode.</li>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
365 "<li>(If this does not happen, then try shorter or longer"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366 " pauses between presses.)</li>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
367 "<li>Ensure the boot volume is available (this may require"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368 " mounting it).</li>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
369 "<li>Select the firmware file to be flashed and click the"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370 " flash button.</li>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371 "</ol>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 ),
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 "firmware": "CircuitPython",
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
374 },
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
375
8167
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
376 "circuitpython_rp2040": {
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
377 "volumes": {
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
378 (0x239A, 0x80F4): [
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
379 "RPI-RP2", # Raspberry Pi Pico loaded with CircuitPython
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
380 ],
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
381 },
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
382 "instructions": QCoreApplication.translate(
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
383 "UF2FlashDialog",
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
384 "<h3>Pi Pico (RP2040) Board</h3>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
385 "<p>In order to prepare the board for flashing follow these"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
386 " steps:</p><ol>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
387 "<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
388 "<ul>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
389 "<li>Plug in your board while holding the BOOTSEL button.</li>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
390 "</ul>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
391 "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
392 "<ul>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
393 "<li>hold down RESET</li>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
394 "<li>hold down BOOTSEL</li>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
395 "<li>release RESET</li>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
396 "<li>release BOOTSEL</li>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
397 "</ul></li>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
398 "<li>Wait until the device has entered 'bootloader' mode.</li>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
399 "<li>Ensure the boot volume is available (this may require"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
400 " mounting it).</li>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
401 "<li>Select the firmware file to be flashed and click the"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
402 " flash button.</li>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
403 "</ol>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
404 ),
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
405 "firmware": "CircuitPython",
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
406 },
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
407
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
408 "rp2040": {
8111
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
409 "volumes": {
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
410 (0x0000, 0x0000): [
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
411 "RPI-RP2", # Raspberry Pi Pico does not present a TTY
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
412 ],
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
413 },
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
414 "instructions": QCoreApplication.translate(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
415 "UF2FlashDialog",
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
416 "<h3>Pi Pico (RP2040) Board</h3>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
417 "<p>In order to prepare the board for flashing follow these"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
418 " steps:</p><ol>"
8167
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
419 "<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
420 "<ul>"
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
421 "<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
422 "</ul>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
423 "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
424 "<ul>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
425 "<li>hold down RESET</li>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
426 "<li>hold down BOOTSEL</li>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
427 "<li>release RESET</li>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
428 "<li>release BOOTSEL</li>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
429 "</ul></li>"
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
430 "<li>Wait until the device has entered 'bootloader' mode.</li>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
431 "<li>Ensure the boot volume is available (this may require"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
432 " mounting it).</li>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
433 "<li>Select the firmware file to be flashed and click the"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
434 " flash button.</li>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
435 "</ol>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
436 ),
8120
84928e9f446f UF2FlashDialog: updated a string.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8111
diff changeset
437 "firmware": "MicroPython / CircuitPython",
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
438 },
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
439 }
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
440
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
441
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
442 def getFoundDevices(boardType=""):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
443 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
444 Function to get the list of known serial devices supporting UF2.
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
445
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
446 @param boardType specific board type to search for
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
447 @type str
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
448 @return list of tuples with the board type, the port description, the
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
449 VID and PID
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
450 @rtype list of tuple of (str, str, int, int)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
451 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
452 from PyQt5.QtSerialPort import QSerialPortInfo
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
453
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
454 foundDevices = []
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
455
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
456 availablePorts = QSerialPortInfo.availablePorts()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
457 for port in availablePorts:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
458 vid = port.vendorIdentifier()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
459 pid = port.productIdentifier()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
460
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
461 if vid == 0 and pid == 0:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
462 # no device detected at port
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
463 continue
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
464
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
465 for board in SupportedUF2Boards:
8167
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
466 if not boardType or (board.startswith(boardType)):
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
467 if (vid, pid) in SupportedUF2Boards[board]["volumes"]:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
468 foundDevices.append((
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
469 board,
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
470 port.description(),
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
471 (vid, pid),
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
472 ))
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
473
8111
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
474 # second run for boards needing special treatment (e.g. RP2040)
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
475 for board in SupportedUF2Boards:
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
476 if not boardType or (board == boardType):
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
477 try:
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
478 # find mounted volume
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
479 volumes = SupportedUF2Boards[board]["volumes"][(0, 0)]
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
480 foundVolumes = []
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
481 for volume in volumes:
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
482 foundVolumes += Utilities.findVolume(volume, findAll=True)
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
483 if foundVolumes:
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
484 foundDevices.append((
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
485 board,
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
486 QCoreApplication.translate(
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
487 "UF2FlashDialog", "'{0}' Board").format(board),
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
488 (0, 0), # VID/PID of (0, 0) is special
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
489 ))
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
490 except KeyError:
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
491 # no special treatment required, carry on
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
492 pass
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
493
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
494 return foundDevices
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
495
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
496
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
497 class UF2FlashDialog(QDialog, Ui_UF2FlashDialog):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
498 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
499 Class implementing a dialog to flash any UF2 capable device.
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
500 """
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
501 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
502 DeviceVidPidRole = Qt.ItemDataRole.UserRole + 1
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
503
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
504 def __init__(self, boardType="", parent=None):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
505 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
506 Constructor
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
507
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
508 @param boardType specific board type to show the dialog for
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
509 @type str
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
510 @param parent reference to the parent widget (defaults to None)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
511 @type QWidget (optional)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
512 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
513 super(UF2FlashDialog, self).__init__(parent)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
514 self.setupUi(self)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
515
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
516 self.refreshButton.setIcon(UI.PixmapCache.getIcon("rescan"))
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
517
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
518 self.firmwarePicker.setMode(E5PathPickerModes.OpenFileMode)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
519 self.firmwarePicker.setFilters(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
520 self.tr("MicroPython/CircuitPython Files (*.uf2);;"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
521 "All Files (*)"))
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
522
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
523 self.bootPicker.setMode(E5PathPickerModes.DirectoryShowFilesMode)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
524 self.bootPicker.setEnabled(False)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
525
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
526 self.__mandatoryStyleSheet = (
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
527 "QLineEdit {border: 2px solid;border-color: #800000}"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
528 )
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
529 self.__manualType = "<manual>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
530
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
531 self.__boardType = boardType
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
532
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
533 self.__populate()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
534
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
535 self.__updateFlashButton()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
536
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
537 def __populate(self):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
538 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
539 Private method to (re-)populate the dialog.
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
540 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
541 # save the currently selected device
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
542 currentDevice = self.devicesComboBox.currentText()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
543 firmwareFile = self.firmwarePicker.text()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
544
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
545 # clear the entries first
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
546 self.devicesComboBox.clear()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
547 self.firmwarePicker.clear()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
548 self.bootPicker.clear()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
549 self.infoLabel.clear()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
550 self.infoEdit.clear()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
551
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
552 # now populate the entries with data
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
553 devices = getFoundDevices(boardType=self.__boardType)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
554 if len(devices) == 0:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
555 # no device detected
8111
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
556 devices = list(filter(
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
557 lambda x: x[0] in SupportedUF2Boards,
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
558 MicroPythonDevices.getFoundDevices()[0]
8111
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
559 ))
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
560 if devices:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
561 self.__showSpecificInstructions(list(devices))
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
562 else:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
563 self.__showAllInstructions()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
564 self.devicesComboBox.addItem("")
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
565 self.devicesComboBox.addItem(self.tr("Manual Select"))
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
566 self.devicesComboBox.setItemData(1, self.__manualType,
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
567 self.DeviceTypeRole)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
568 elif len(devices) == 1:
8167
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
569 # 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
570 self.__boardType = devices[0][0]
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
571
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
572 self.devicesComboBox.addItem(devices[0][1])
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
573 self.devicesComboBox.setItemData(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
574 0, devices[0][0], self.DeviceTypeRole)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
575 self.devicesComboBox.setItemData(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
576 0, devices[0][2], self.DeviceVidPidRole)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
577 self.devicesComboBox.addItem(self.tr("Manual Select"))
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
578 self.devicesComboBox.setItemData(1, self.__manualType,
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
579 self.DeviceTypeRole)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
580 self.on_devicesComboBox_currentIndexChanged(0)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
581 else:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
582 self.devicesComboBox.addItem("")
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
583 for index, (boardType, description,
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
584 vidpid) in enumerate(sorted(devices), 1):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
585 self.devicesComboBox.addItem(description)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
586 self.devicesComboBox.setItemData(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
587 index, boardType, self.DeviceTypeRole)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
588 self.devicesComboBox.setItemData(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
589 index, vidpid, self.DeviceVidPidRole)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
590 self.devicesComboBox.addItem(self.tr("Manual Select"))
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
591 self.devicesComboBox.setItemData(index + 1, self.__manualType,
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
592 self.DeviceTypeRole)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
593
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
594 # reselect the remembered device, if it is still there
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
595 if currentDevice:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
596 self.devicesComboBox.setCurrentText(currentDevice)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
597 self.firmwarePicker.setText(firmwareFile)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
598 else:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
599 self.devicesComboBox.setCurrentIndex(0)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
600
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
601 def __updateFlashButton(self):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
602 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
603 Private method to update the state of the Flash button and the retest
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
604 button.
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
605 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
606 firmwareFile = self.firmwarePicker.text()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
607 if self.devicesComboBox.currentData(self.DeviceTypeRole) is not None:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
608 if bool(firmwareFile) and os.path.exists(firmwareFile):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
609 self.firmwarePicker.setStyleSheet("")
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
610 else:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
611 self.firmwarePicker.setStyleSheet(self.__mandatoryStyleSheet)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
612
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
613 if bool(self.bootPicker.text()):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
614 self.bootPicker.setStyleSheet("")
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
615 else:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
616 self.bootPicker.setStyleSheet(self.__mandatoryStyleSheet)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
617 else:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
618 self.firmwarePicker.setStyleSheet("")
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
619 self.bootPicker.setStyleSheet("")
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
620
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
621 enable = (
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
622 bool(self.bootPicker.text()) and
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
623 bool(firmwareFile) and
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
624 os.path.exists(firmwareFile)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
625 )
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
626 self.flashButton.setEnabled(enable)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
627
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
628 def __showAllInstructions(self):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
629 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
630 Private method to show instructions for resetting devices to bootloader
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
631 mode.
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
632 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
633 self.infoLabel.setText(self.tr("Reset Instructions:"))
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
634
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
635 htmlText = self.tr(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
636 "<h4>No known devices detected.</h4>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
637 "<p>Follow the appropriate instructions below to set <b>one</b>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
638 " board into 'bootloader' mode. Press <b>Refresh</b> when ready."
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
639 "</p>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
640 )
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
641 for boardType in SupportedUF2Boards:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
642 htmlText += "<hr/>" + SupportedUF2Boards[boardType]["instructions"]
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
643 self.infoEdit.setHtml(htmlText)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
644
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
645 def __showSpecificInstructions(self, devices):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
646 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
647 Private method to show instructions for resetting devices to bootloader
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
648 mode for a list of detected devices.
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
649
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
650 @param devices list of detected devices
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
651 @type list of str
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
652 """
8099
522946e53835 Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8097
diff changeset
653 boardTypes = {x[0] for x in devices}
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
654
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
655 self.infoLabel.setText(self.tr("Reset Instructions:"))
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
656
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
657 if self.__boardType:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
658 htmlText = self.tr(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
659 "<h4>Flash {0} Firmware</h4>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
660 "<p>Follow the instructions below to set <b>one</b> board into"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
661 " 'bootloader' mode. Press <b>Refresh</b> when ready.</p>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
662 "<hr/>{1}"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
663 ).format(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
664 SupportedUF2Boards[self.__boardType]["firmware"],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
665 SupportedUF2Boards[self.__boardType]["instructions"],
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
666 )
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
667 else:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
668 htmlText = self.tr(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
669 "<h4>Potentially UF2 capable devices found</h4>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
670 "<p>Found these potentially UF2 capable devices:</p>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
671 "<ul><li>{0}</li></ul>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
672 "<p>Follow the instructions below to set <b>one</b> board into"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
673 " 'bootloader' mode. Press <b>Refresh</b> when ready.</p>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
674 ).format(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
675 "</li><li>".join(sorted(x[1] for x in devices))
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
676 )
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
677 for boardType in sorted(boardTypes):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
678 htmlText += (
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
679 "<hr/>" + SupportedUF2Boards[boardType]["instructions"]
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
680 )
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
681 self.infoEdit.setHtml(htmlText)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
682
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
683 def __showTypedInstructions(self, boardType):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
684 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
685 Private method to show instructions for resetting devices to bootloader
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
686 mode for a specific board type.
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
687
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
688 @param boardType type of the board to show instructions for
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
689 @type str
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
690 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
691 self.infoLabel.setText(self.tr("Reset Instructions:"))
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
692
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
693 htmlText = self.tr(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
694 "<h4>No known devices detected.</h4>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
695 "<p>Follow the instructions below to set <b>one</b> board into"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
696 " 'bootloader' mode. Press <b>Refresh</b> when ready.</p>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
697 )
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
698 htmlText += "<hr/>" + SupportedUF2Boards[boardType]["instructions"]
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
699 self.infoEdit.setHtml(htmlText)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
700
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
701 def __showManualInstructions(self):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
702 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
703 Private method to show instructions for flashing devices manually.
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
704 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
705 self.infoLabel.setText(self.tr("Flash Instructions:"))
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
706
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
707 htmlText = self.tr(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
708 "<h4>Flash method 'manual' selected.</h4>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
709 "<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
710 " the data manually.</p><ol>"
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
711 "<li>Change the device to 'bootloader' mode.</li>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
712 "<li>Wait until the device has entered 'bootloader' mode.</li>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
713 "<li>Ensure the boot volume is available (this may require"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
714 " mounting it) and select its path.</li>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
715 "<li>Select the firmware file to be flashed and click the"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
716 " flash button.</li>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
717 "</ol>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
718 )
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
719 for boardType in SupportedUF2Boards:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
720 htmlText += "<hr/>" + SupportedUF2Boards[boardType]["instructions"]
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
721 self.infoEdit.setHtml(htmlText)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
722
8167
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
723 def __showNoVolumeInformation(self, volumes, boardType):
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
724 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
725 Private method to show information about the expected boot volume(s).
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
726
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
727 @param volumes list of expected volume names
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
728 @type list of str
8167
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
729 @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
730 @type str
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
731 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
732 self.infoLabel.setText(self.tr("Boot Volume not found:"))
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
733
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
734 htmlText = self.tr(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
735 "<h4>No Boot Volume detected.</h4>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
736 "<p>Please ensure that the boot volume of the device to be flashed"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
737 " is available. "
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
738 )
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
739 if len(volumes) == 1:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
740 htmlText += self.tr(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
741 "This volume should be named <b>{0}</b>."
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
742 " Press <b>Refresh</b> when ready.</p>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
743 ).format(volumes[0])
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
744 else:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
745 htmlText += self.tr(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
746 "This volume should have one of these names.</p>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
747 "<ul><li>{0}</li></ul>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
748 "<p>Press <b>Refresh</b> when ready.</p>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
749 ).format("</li><li>".join(sorted(volumes)))
8167
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
750
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
751 if boardType:
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
752 htmlText += self.tr(
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
753 "<h4>Reset Instructions</h4>"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
754 "<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
755 " '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
756 )
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
757 htmlText += "<hr/>" + SupportedUF2Boards[boardType]["instructions"]
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
758
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
759 self.infoEdit.setHtml(htmlText)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
760
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
761 def __showMultipleVolumesInformation(self, volumePaths):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
762 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
763 Private method to show information because multiple devices of the
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
764 same type are ready for flashing.
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
765
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
766 Note: This is a dangerous situation!
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
767
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
768 @param volumePaths list of volume paths
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
769 @type list of str
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
770 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
771 self.infoLabel.setText(self.tr("Multiple Boot Volumes found:"))
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
772
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
773 htmlText = self.tr(
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
774 "<h4>Multiple Boot Volumes were found</h4>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
775 "<p>These volume paths were found.</p><ul><li>{0}</li></ul>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
776 "<p>Please ensure that only one device of a type is ready for"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
777 " flashing. Press <b>Refresh</b> when ready.</p>"
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
778 ).format("</li><li>".join(sorted(volumePaths)))
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
779 self.infoEdit.setHtml(htmlText)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
780
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
781 @pyqtSlot()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
782 def on_flashButton_clicked(self):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
783 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
784 Private slot to flash the selected MicroPython or CircuitPython
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
785 firmware onto the device.
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
786 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
787 boardType = self.devicesComboBox.currentData(self.DeviceTypeRole)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
788 firmwarePath = self.firmwarePicker.text()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
789 volumePath = self.bootPicker.text()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
790 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
791 if boardType == self.__manualType:
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
792 self.infoLabel.setText(self.tr("Flashing Firmware"))
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
793 self.infoEdit.setHtml(self.tr(
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
794 "<p>Flashing the selected firmware to the device. Please"
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
795 " wait until the device resets automatically.</p>")
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
796 )
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
797 else:
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
798 firmwareType = SupportedUF2Boards[boardType]["firmware"]
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
799 self.infoLabel.setText(
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
800 self.tr("Flashing {0}").format(firmwareType))
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
801 self.infoEdit.setHtml(self.tr(
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
802 "<p>Flashing the {0} firmware to the device. Please wait"
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
803 " until the device resets automatically.</p>"
a8e9b387f701 UF2FlashDialog: added support for Raspberry Pi Pico.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8101
diff changeset
804 ).format(firmwareType))
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
805 QCoreApplication.processEvents(
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
806 QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents)
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
807 shutil.copy2(firmwarePath, volumePath)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
808 QThread.sleep(1)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
809 self.on_refreshButton_clicked()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
810
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
811 @pyqtSlot()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
812 def on_refreshButton_clicked(self):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
813 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
814 Private slot to refresh the dialog.
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
815 """
8167
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
816 # special treatment for RPi Pico
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
817 if self.__boardType == "circuitpython_rp2040":
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
818 self.__boardType = "rp2040"
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
819
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
820 self.__populate()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
821
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
822 @pyqtSlot(int)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
823 def on_devicesComboBox_currentIndexChanged(self, index):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
824 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
825 Private slot to handle the selection of a board.
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
826
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
827 @param index selected index
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
828 @type int
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
829 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
830 vidpid = self.devicesComboBox.itemData(index, self.DeviceVidPidRole)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
831 boardType = self.devicesComboBox.itemData(index, self.DeviceTypeRole)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
832
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
833 self.bootPicker.setEnabled(boardType == self.__manualType)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
834 if boardType == self.__manualType:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
835 self.__showManualInstructions()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
836
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
837 if vidpid is None:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
838 if boardType is None:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
839 self.bootPicker.clear()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
840 else:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
841 volumes = SupportedUF2Boards[boardType]["volumes"][vidpid]
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
842 foundVolumes = []
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
843 for volume in volumes:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
844 foundVolumes += Utilities.findVolume(volume, findAll=True)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
845
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
846 if len(foundVolumes) == 0:
8167
cdc1b6692766 MicroPython: improved the UF2 Flash dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
847 self.__showNoVolumeInformation(volumes, boardType)
8096
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
848 self.bootPicker.clear()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
849 elif len(foundVolumes) == 1:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
850 self.bootPicker.setText(foundVolumes[0])
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
851 else:
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
852 self.__showMultipleVolumesInformation()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
853 self.bootPicker.clear()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
854
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
855 self.__updateFlashButton()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
856
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
857 @pyqtSlot(str)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
858 def on_firmwarePicker_textChanged(self, text):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
859 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
860 Private slot handling a change of the firmware file.
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
861
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
862 @param text current text of the firmware edit
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
863 @type str
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
864 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
865 self.__updateFlashButton()
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
866
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
867 @pyqtSlot(str)
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
868 def on_bootPicker_textChanged(self, text):
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
869 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
870 Private slot handling a change of the boot volume.
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
871
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
872 @param text current text of the boot volume edit
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
873 @type str
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
874 """
5425a9072300 MicroPython
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
875 self.__updateFlashButton()

eric ide

mercurial