mpflash 0.7.6__py3-none-any.whl → 0.7.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
mpflash/cli_group.py CHANGED
@@ -3,6 +3,8 @@ Main entry point for the CLI group.
3
3
  Additional comands are added in the submodules.
4
4
  """
5
5
 
6
+ import sys
7
+
6
8
  import rich_click as click
7
9
 
8
10
  from .config import config
@@ -23,6 +25,8 @@ def cb_verbose(ctx, param, value):
23
25
  def cb_ignore(ctx, param, value):
24
26
  if value:
25
27
  config.ignore_ports = list(value)
28
+ if sys.platform == "win32":
29
+ config.ignore_ports = [port.upper() for port in config.ignore_ports]
26
30
  return value
27
31
 
28
32
 
@@ -32,6 +36,12 @@ def cb_interactive(ctx, param, value):
32
36
  return value
33
37
 
34
38
 
39
+ def cb_test(ctx, param, value):
40
+ if value:
41
+ config.tests = value
42
+ return value
43
+
44
+
35
45
  def cb_quiet(ctx, param, value):
36
46
  if value:
37
47
  make_quiet()
@@ -80,6 +90,17 @@ def cb_quiet(ctx, param, value):
80
90
  show_default=True,
81
91
  metavar="SERIALPORT",
82
92
  )
93
+ @click.option(
94
+ "--test",
95
+ is_eager=True,
96
+ help="test a specific feature",
97
+ callback=cb_test,
98
+ multiple=True,
99
+ default=[],
100
+ envvar="MPFLASH_TEST",
101
+ show_default=True,
102
+ metavar="TEST",
103
+ )
83
104
  def cli(**kwargs):
84
105
  """mpflash - MicroPython Tool.
85
106
 
mpflash/config.py CHANGED
@@ -14,6 +14,8 @@ class MPtoolConfig:
14
14
  ignore_ports: List[str] = []
15
15
  interactive: bool = True
16
16
  firmware_folder: Path = platformdirs.user_downloads_path() / "firmware"
17
+ # test options specified on the commandline
18
+ tests: List[str] = []
17
19
 
18
20
 
19
21
  config = MPtoolConfig()
mpflash/flash_uf2.py CHANGED
@@ -14,7 +14,9 @@ from rich.progress import track
14
14
  from mpflash.mpremoteboard import MPRemoteBoard
15
15
 
16
16
  from .common import PORT_FWTYPES
17
+ from .config import config
17
18
  from .flash_uf2_linux import dismount_uf2, wait_for_UF2_linux
19
+ from .flash_uf2_macos import wait_for_UF2_macos
18
20
  from .flash_uf2_windows import wait_for_UF2_windows
19
21
 
20
22
 
@@ -41,9 +43,15 @@ def flash_uf2(mcu: MPRemoteBoard, fw_file: Path, erase: bool) -> Optional[MPRemo
41
43
  destination = wait_for_UF2_linux()
42
44
  elif sys.platform == "win32":
43
45
  destination = wait_for_UF2_windows()
46
+ elif sys.platform == "darwin":
47
+ log.warning(f"OS {sys.platform} not tested/supported")
48
+ # TODO: test which of the options is best
49
+ if "macos_uf2" in config.tests:
50
+ destination = wait_for_UF2_macos()
51
+ else:
52
+ destination = wait_for_UF2_linux()
44
53
  else:
45
54
  log.warning(f"OS {sys.platform} not tested/supported")
46
- destination = wait_for_UF2_linux()
47
55
  return None
48
56
 
49
57
  if not destination or not destination.exists() or not (destination / "INFO_UF2.TXT").exists():
@@ -54,7 +62,7 @@ def flash_uf2(mcu: MPRemoteBoard, fw_file: Path, erase: bool) -> Optional[MPRemo
54
62
  log.info(f"Copying {fw_file} to {destination}.")
55
63
  shutil.copy(fw_file, destination)
56
64
  log.success("Done copying, resetting the board and wait for it to restart")
57
- if sys.platform in ["linux", "darwin"]:
65
+ if sys.platform in ["linux"]:
58
66
  dismount_uf2()
59
67
  for _ in track(range(5 + 2), description="Waiting for the board to restart", transient=True, refresh_per_second=2):
60
68
  time.sleep(1) # 5 secs to short on linux
@@ -13,28 +13,15 @@ from loguru import logger as log
13
13
  from rich.progress import track
14
14
 
15
15
  from .flash_uf2_boardid import get_board_id
16
+ from .uf2disk import UF2Disk
16
17
 
17
18
  glb_dismount_me: List[UF2Disk] = []
18
19
 
19
20
 
20
- class UF2Disk:
21
- """Info to support mounting and unmounting of UF2 drives on linux"""
22
-
23
- device_path: str
24
- label: str
25
- mountpoint: str
26
-
27
- def __repr__(self):
28
- return repr(self.__dict__)
29
-
30
-
31
21
  def get_uf2_drives():
32
22
  """
33
23
  Get a list of all the (un)mounted UF2 drives
34
24
  """
35
- if sys.platform != "linux":
36
- log.error("pumount only works on Linux")
37
- return
38
25
  # import blkinfo only on linux
39
26
  from blkinfo import BlkDiskInfo
40
27
 
@@ -113,7 +100,9 @@ def wait_for_UF2_linux(s_max: int = 10):
113
100
  wait = 10
114
101
  uf2_drives = []
115
102
  # while not destination and wait > 0:
116
- for _ in track(range(s_max), description="Waiting for mcu to mount as a drive", transient=True,refresh_per_second=2):
103
+ for _ in track(
104
+ range(s_max), description="Waiting for mcu to mount as a drive", transient=True, refresh_per_second=2
105
+ ):
117
106
  # log.info(f"Waiting for mcu to mount as a drive : {wait} seconds left")
118
107
  uf2_drives += list(get_uf2_drives())
119
108
  for drive in get_uf2_drives():
@@ -0,0 +1,80 @@
1
+ """ Flashing UF2 based MCU on macos"""
2
+
3
+ # sourcery skip: snake-case-functions
4
+ from __future__ import annotations
5
+
6
+ import subprocess
7
+ import sys
8
+ import time
9
+ from pathlib import Path
10
+ from typing import List
11
+
12
+ from loguru import logger as log
13
+ from rich.progress import track
14
+
15
+ from .flash_uf2_boardid import get_board_id
16
+ from .uf2disk import UF2Disk
17
+
18
+
19
+ def get_uf2_drives():
20
+ """
21
+ Get a list of all the (un)mounted UF2 drives
22
+ """
23
+ if sys.platform != "linux":
24
+ log.error("pumount only works on Linux")
25
+ return
26
+ # import blkinfo only on linux
27
+ from blkinfo import BlkDiskInfo
28
+
29
+ myblkd = BlkDiskInfo()
30
+ filters = {
31
+ "tran": "usb",
32
+ }
33
+ usb_disks = myblkd.get_disks(filters)
34
+ for disk in usb_disks:
35
+ if disk["fstype"] == "vfat":
36
+ uf2_part = disk
37
+ # unpartioned usb disk or partition (e.g. /dev/sdb )
38
+ # SEEED WIO Terminal is unpartioned
39
+ # print( json.dumps(uf2_part, indent=4))
40
+ uf2 = UF2Disk()
41
+ uf2.device_path = "/dev/" + uf2_part["name"]
42
+ uf2.label = uf2_part["label"]
43
+ uf2.mountpoint = uf2_part["mountpoint"]
44
+ yield uf2
45
+ elif disk["type"] == "disk" and disk.get("children") and len(disk.get("children")) > 0:
46
+ if disk.get("children")[0]["type"] == "part" and disk.get("children")[0]["fstype"] == "vfat":
47
+ uf2_part = disk.get("children")[0]
48
+ # print( json.dumps(uf2_part, indent=4))
49
+ uf2 = UF2Disk()
50
+ uf2.device_path = "/dev/" + uf2_part["name"]
51
+ uf2.label = uf2_part["label"]
52
+ uf2.mountpoint = uf2_part["mountpoint"]
53
+ yield uf2
54
+
55
+
56
+ def wait_for_UF2_macos(s_max: int = 10):
57
+ destination = ""
58
+ wait = 10
59
+ uf2_drives = []
60
+ # while not destination and wait > 0:
61
+ for _ in track(
62
+ range(s_max), description="Waiting for mcu to mount as a drive", transient=True, refresh_per_second=2
63
+ ):
64
+ # log.info(f"Waiting for mcu to mount as a drive : {wait} seconds left")
65
+ uf2_drives += list(get_uf2_drives())
66
+ for drive in get_uf2_drives():
67
+ time.sleep(1)
68
+ try:
69
+ if Path(drive.mountpoint, "INFO_UF2.TXT").exists():
70
+ board_id = get_board_id(Path(drive.mountpoint)) # type: ignore
71
+ destination = Path(drive.mountpoint)
72
+ break
73
+ except PermissionError:
74
+ log.debug(f"Permission error on {drive.mountpoint}")
75
+ continue
76
+ if destination:
77
+ break
78
+ time.sleep(1)
79
+ wait -= 1
80
+ return destination
@@ -0,0 +1,406 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "metadata": {},
7
+ "outputs": [
8
+ {
9
+ "data": {
10
+ "text/html": [
11
+ "<div>\n",
12
+ "<style scoped>\n",
13
+ " .dataframe tbody tr th:only-of-type {\n",
14
+ " vertical-align: middle;\n",
15
+ " }\n",
16
+ "\n",
17
+ " .dataframe tbody tr th {\n",
18
+ " vertical-align: top;\n",
19
+ " }\n",
20
+ "\n",
21
+ " .dataframe thead th {\n",
22
+ " text-align: right;\n",
23
+ " }\n",
24
+ "</style>\n",
25
+ "<table border=\"1\" class=\"dataframe\">\n",
26
+ " <thead>\n",
27
+ " <tr style=\"text-align: right;\">\n",
28
+ " <th></th>\n",
29
+ " <th>description</th>\n",
30
+ " <th>port</th>\n",
31
+ " <th>board</th>\n",
32
+ " <th>board_name</th>\n",
33
+ " <th>mcu_name</th>\n",
34
+ " <th>path</th>\n",
35
+ " <th>version</th>\n",
36
+ " </tr>\n",
37
+ " </thead>\n",
38
+ " <tbody>\n",
39
+ " <tr>\n",
40
+ " <th>0</th>\n",
41
+ " <td>4MB/OTA module with ESP32</td>\n",
42
+ " <td>esp32</td>\n",
43
+ " <td>GENERIC_OTA</td>\n",
44
+ " <td>4MB/OTA module</td>\n",
45
+ " <td>ESP32</td>\n",
46
+ " <td>ports/esp32/boards/GENERIC_OTA/mpconfigboard.h</td>\n",
47
+ " <td>v1.20.0</td>\n",
48
+ " </tr>\n",
49
+ " <tr>\n",
50
+ " <th>1</th>\n",
51
+ " <td>4MB/OTA module with ESP32</td>\n",
52
+ " <td>esp32</td>\n",
53
+ " <td>GENERIC_OTA</td>\n",
54
+ " <td>4MB/OTA module</td>\n",
55
+ " <td>ESP32</td>\n",
56
+ " <td>ports/esp32/boards/GENERIC_OTA/mpconfigboard.h</td>\n",
57
+ " <td>v1.19.1</td>\n",
58
+ " </tr>\n",
59
+ " <tr>\n",
60
+ " <th>2</th>\n",
61
+ " <td>4MB/OTA module with ESP32</td>\n",
62
+ " <td>esp32</td>\n",
63
+ " <td>GENERIC_OTA</td>\n",
64
+ " <td>4MB/OTA module</td>\n",
65
+ " <td>ESP32</td>\n",
66
+ " <td>ports/esp32/boards/GENERIC_OTA/mpconfigboard.h</td>\n",
67
+ " <td>v1.19</td>\n",
68
+ " </tr>\n",
69
+ " <tr>\n",
70
+ " <th>3</th>\n",
71
+ " <td>4MB/OTA module with ESP32</td>\n",
72
+ " <td>esp32</td>\n",
73
+ " <td>GENERIC_OTA</td>\n",
74
+ " <td>4MB/OTA module</td>\n",
75
+ " <td>ESP32</td>\n",
76
+ " <td>ports/esp32/boards/GENERIC_OTA/mpconfigboard.h</td>\n",
77
+ " <td>v1.18</td>\n",
78
+ " </tr>\n",
79
+ " <tr>\n",
80
+ " <th>4</th>\n",
81
+ " <td>4MB/OTA module with ESP32</td>\n",
82
+ " <td>esp32</td>\n",
83
+ " <td>GENERIC_OTA</td>\n",
84
+ " <td>4MB/OTA module</td>\n",
85
+ " <td>ESP32</td>\n",
86
+ " <td>ports/esp32/boards/GENERIC_OTA/mpconfigboard.h</td>\n",
87
+ " <td>v1.17</td>\n",
88
+ " </tr>\n",
89
+ " <tr>\n",
90
+ " <th>...</th>\n",
91
+ " <td>...</td>\n",
92
+ " <td>...</td>\n",
93
+ " <td>...</td>\n",
94
+ " <td>...</td>\n",
95
+ " <td>...</td>\n",
96
+ " <td>...</td>\n",
97
+ " <td>...</td>\n",
98
+ " </tr>\n",
99
+ " <tr>\n",
100
+ " <th>2207</th>\n",
101
+ " <td>XIAO nRF52840 Sense with NRF52840</td>\n",
102
+ " <td>nrf</td>\n",
103
+ " <td>SEEED_XIAO_NRF52</td>\n",
104
+ " <td>XIAO nRF52840 Sense</td>\n",
105
+ " <td>NRF52840</td>\n",
106
+ " <td>ports/nrf/boards/SEEED_XIAO_NRF52/mpconfigboard.h</td>\n",
107
+ " <td>v1.22.1</td>\n",
108
+ " </tr>\n",
109
+ " <tr>\n",
110
+ " <th>2208</th>\n",
111
+ " <td>XIAO nRF52840 Sense with NRF52840</td>\n",
112
+ " <td>nrf</td>\n",
113
+ " <td>SEEED_XIAO_NRF52</td>\n",
114
+ " <td>XIAO nRF52840 Sense</td>\n",
115
+ " <td>NRF52840</td>\n",
116
+ " <td>ports/nrf/boards/SEEED_XIAO_NRF52/mpconfigboard.h</td>\n",
117
+ " <td>v1.22.0-preview</td>\n",
118
+ " </tr>\n",
119
+ " <tr>\n",
120
+ " <th>2209</th>\n",
121
+ " <td>XIAO nRF52840 Sense with NRF52840</td>\n",
122
+ " <td>nrf</td>\n",
123
+ " <td>SEEED_XIAO_NRF52</td>\n",
124
+ " <td>XIAO nRF52840 Sense</td>\n",
125
+ " <td>NRF52840</td>\n",
126
+ " <td>ports/nrf/boards/SEEED_XIAO_NRF52/mpconfigboard.h</td>\n",
127
+ " <td>v1.22.0</td>\n",
128
+ " </tr>\n",
129
+ " <tr>\n",
130
+ " <th>2210</th>\n",
131
+ " <td>XIAO nRF52840 Sense with NRF52840</td>\n",
132
+ " <td>nrf</td>\n",
133
+ " <td>SEEED_XIAO_NRF52</td>\n",
134
+ " <td>XIAO nRF52840 Sense</td>\n",
135
+ " <td>NRF52840</td>\n",
136
+ " <td>ports/nrf/boards/SEEED_XIAO_NRF52/mpconfigboard.h</td>\n",
137
+ " <td>v1.21.0</td>\n",
138
+ " </tr>\n",
139
+ " <tr>\n",
140
+ " <th>2211</th>\n",
141
+ " <td>XIAO nRF52840 Sense with NRF52840</td>\n",
142
+ " <td>nrf</td>\n",
143
+ " <td>seeed_xiao_nrf52</td>\n",
144
+ " <td>XIAO nRF52840 Sense</td>\n",
145
+ " <td>NRF52840</td>\n",
146
+ " <td>ports/nrf/boards/seeed_xiao_nrf52/mpconfigboard.h</td>\n",
147
+ " <td>v1.20.0</td>\n",
148
+ " </tr>\n",
149
+ " </tbody>\n",
150
+ "</table>\n",
151
+ "<p>2212 rows × 7 columns</p>\n",
152
+ "</div>"
153
+ ],
154
+ "text/plain": [
155
+ " description port board \\\n",
156
+ "0 4MB/OTA module with ESP32 esp32 GENERIC_OTA \n",
157
+ "1 4MB/OTA module with ESP32 esp32 GENERIC_OTA \n",
158
+ "2 4MB/OTA module with ESP32 esp32 GENERIC_OTA \n",
159
+ "3 4MB/OTA module with ESP32 esp32 GENERIC_OTA \n",
160
+ "4 4MB/OTA module with ESP32 esp32 GENERIC_OTA \n",
161
+ "... ... ... ... \n",
162
+ "2207 XIAO nRF52840 Sense with NRF52840 nrf SEEED_XIAO_NRF52 \n",
163
+ "2208 XIAO nRF52840 Sense with NRF52840 nrf SEEED_XIAO_NRF52 \n",
164
+ "2209 XIAO nRF52840 Sense with NRF52840 nrf SEEED_XIAO_NRF52 \n",
165
+ "2210 XIAO nRF52840 Sense with NRF52840 nrf SEEED_XIAO_NRF52 \n",
166
+ "2211 XIAO nRF52840 Sense with NRF52840 nrf seeed_xiao_nrf52 \n",
167
+ "\n",
168
+ " board_name mcu_name \\\n",
169
+ "0 4MB/OTA module ESP32 \n",
170
+ "1 4MB/OTA module ESP32 \n",
171
+ "2 4MB/OTA module ESP32 \n",
172
+ "3 4MB/OTA module ESP32 \n",
173
+ "4 4MB/OTA module ESP32 \n",
174
+ "... ... ... \n",
175
+ "2207 XIAO nRF52840 Sense NRF52840 \n",
176
+ "2208 XIAO nRF52840 Sense NRF52840 \n",
177
+ "2209 XIAO nRF52840 Sense NRF52840 \n",
178
+ "2210 XIAO nRF52840 Sense NRF52840 \n",
179
+ "2211 XIAO nRF52840 Sense NRF52840 \n",
180
+ "\n",
181
+ " path version \n",
182
+ "0 ports/esp32/boards/GENERIC_OTA/mpconfigboard.h v1.20.0 \n",
183
+ "1 ports/esp32/boards/GENERIC_OTA/mpconfigboard.h v1.19.1 \n",
184
+ "2 ports/esp32/boards/GENERIC_OTA/mpconfigboard.h v1.19 \n",
185
+ "3 ports/esp32/boards/GENERIC_OTA/mpconfigboard.h v1.18 \n",
186
+ "4 ports/esp32/boards/GENERIC_OTA/mpconfigboard.h v1.17 \n",
187
+ "... ... ... \n",
188
+ "2207 ports/nrf/boards/SEEED_XIAO_NRF52/mpconfigboard.h v1.22.1 \n",
189
+ "2208 ports/nrf/boards/SEEED_XIAO_NRF52/mpconfigboard.h v1.22.0-preview \n",
190
+ "2209 ports/nrf/boards/SEEED_XIAO_NRF52/mpconfigboard.h v1.22.0 \n",
191
+ "2210 ports/nrf/boards/SEEED_XIAO_NRF52/mpconfigboard.h v1.21.0 \n",
192
+ "2211 ports/nrf/boards/seeed_xiao_nrf52/mpconfigboard.h v1.20.0 \n",
193
+ "\n",
194
+ "[2212 rows x 7 columns]"
195
+ ]
196
+ },
197
+ "execution_count": 1,
198
+ "metadata": {},
199
+ "output_type": "execute_result"
200
+ }
201
+ ],
202
+ "source": [
203
+ "import pandas as pd\n",
204
+ "\n",
205
+ "# Specify the file path\n",
206
+ "file_path = \"src/mpflash/mpflash/mpboard_id/board_info.json\"\n",
207
+ "\n",
208
+ "# Load the JSON file into a dataframe\n",
209
+ "df = pd.read_json(file_path)\n",
210
+ "\n",
211
+ "# Display the dataframe\n",
212
+ "df\n"
213
+ ]
214
+ },
215
+ {
216
+ "cell_type": "code",
217
+ "execution_count": 12,
218
+ "metadata": {},
219
+ "outputs": [
220
+ {
221
+ "data": {
222
+ "text/html": [
223
+ "<div>\n",
224
+ "<style scoped>\n",
225
+ " .dataframe tbody tr th:only-of-type {\n",
226
+ " vertical-align: middle;\n",
227
+ " }\n",
228
+ "\n",
229
+ " .dataframe tbody tr th {\n",
230
+ " vertical-align: top;\n",
231
+ " }\n",
232
+ "\n",
233
+ " .dataframe thead th {\n",
234
+ " text-align: right;\n",
235
+ " }\n",
236
+ "</style>\n",
237
+ "<table border=\"1\" class=\"dataframe\">\n",
238
+ " <thead>\n",
239
+ " <tr style=\"text-align: right;\">\n",
240
+ " <th></th>\n",
241
+ " <th>description</th>\n",
242
+ " <th>port</th>\n",
243
+ " <th>board</th>\n",
244
+ " <th>board_name</th>\n",
245
+ " <th>mcu_name</th>\n",
246
+ " <th>path</th>\n",
247
+ " <th>version</th>\n",
248
+ " </tr>\n",
249
+ " </thead>\n",
250
+ " <tbody>\n",
251
+ " <tr>\n",
252
+ " <th>354</th>\n",
253
+ " <td>ESP32-D2WD</td>\n",
254
+ " <td>esp32</td>\n",
255
+ " <td>ESP32_GENERIC</td>\n",
256
+ " <td>-</td>\n",
257
+ " <td>-</td>\n",
258
+ " <td>ports/esp32/boards/ESP32_GENERIC/mpconfigboard...</td>\n",
259
+ " <td>v1.22.2</td>\n",
260
+ " </tr>\n",
261
+ " <tr>\n",
262
+ " <th>364</th>\n",
263
+ " <td>ESP32-UNICORE</td>\n",
264
+ " <td>esp32</td>\n",
265
+ " <td>ESP32_GENERIC</td>\n",
266
+ " <td>-</td>\n",
267
+ " <td>-</td>\n",
268
+ " <td>ports/esp32/boards/ESP32_GENERIC/mpconfigboard...</td>\n",
269
+ " <td>v1.22.2</td>\n",
270
+ " </tr>\n",
271
+ " <tr>\n",
272
+ " <th>370</th>\n",
273
+ " <td>ESP32C3 module with ESP32C3</td>\n",
274
+ " <td>esp32</td>\n",
275
+ " <td>ESP32_GENERIC_C3</td>\n",
276
+ " <td>ESP32C3 module</td>\n",
277
+ " <td>ESP32C3</td>\n",
278
+ " <td>ports/esp32/boards/ESP32_GENERIC_C3/mpconfigbo...</td>\n",
279
+ " <td>v1.22.2</td>\n",
280
+ " </tr>\n",
281
+ " <tr>\n",
282
+ " <th>602</th>\n",
283
+ " <td>Generic ESP32 module with ESP32</td>\n",
284
+ " <td>esp32</td>\n",
285
+ " <td>ESP32_GENERIC</td>\n",
286
+ " <td>Generic ESP32 module</td>\n",
287
+ " <td>ESP32</td>\n",
288
+ " <td>ports/esp32/boards/ESP32_GENERIC/mpconfigboard.h</td>\n",
289
+ " <td>v1.22.2</td>\n",
290
+ " </tr>\n",
291
+ " <tr>\n",
292
+ " <th>608</th>\n",
293
+ " <td>Generic ESP32 module with OTA</td>\n",
294
+ " <td>esp32</td>\n",
295
+ " <td>ESP32_GENERIC</td>\n",
296
+ " <td>-</td>\n",
297
+ " <td>-</td>\n",
298
+ " <td>ports/esp32/boards/ESP32_GENERIC/mpconfigboard...</td>\n",
299
+ " <td>v1.22.2</td>\n",
300
+ " </tr>\n",
301
+ " <tr>\n",
302
+ " <th>614</th>\n",
303
+ " <td>Generic ESP32 module with SPIRAM</td>\n",
304
+ " <td>esp32</td>\n",
305
+ " <td>ESP32_GENERIC</td>\n",
306
+ " <td>-</td>\n",
307
+ " <td>-</td>\n",
308
+ " <td>ports/esp32/boards/ESP32_GENERIC/mpconfigboard...</td>\n",
309
+ " <td>v1.22.2</td>\n",
310
+ " </tr>\n",
311
+ " <tr>\n",
312
+ " <th>630</th>\n",
313
+ " <td>Generic ESP32S2 module with ESP32S2</td>\n",
314
+ " <td>esp32</td>\n",
315
+ " <td>ESP32_GENERIC_S2</td>\n",
316
+ " <td>Generic ESP32S2 module</td>\n",
317
+ " <td>ESP32S2</td>\n",
318
+ " <td>ports/esp32/boards/ESP32_GENERIC_S2/mpconfigbo...</td>\n",
319
+ " <td>v1.22.2</td>\n",
320
+ " </tr>\n",
321
+ " <tr>\n",
322
+ " <th>636</th>\n",
323
+ " <td>Generic ESP32S3 module with ESP32S3</td>\n",
324
+ " <td>esp32</td>\n",
325
+ " <td>ESP32_GENERIC_S3</td>\n",
326
+ " <td>Generic ESP32S3 module</td>\n",
327
+ " <td>ESP32S3</td>\n",
328
+ " <td>ports/esp32/boards/ESP32_GENERIC_S3/mpconfigbo...</td>\n",
329
+ " <td>v1.22.2</td>\n",
330
+ " </tr>\n",
331
+ " <tr>\n",
332
+ " <th>642</th>\n",
333
+ " <td>Generic ESP32S3 module with Octal-SPIRAM</td>\n",
334
+ " <td>esp32</td>\n",
335
+ " <td>ESP32_GENERIC_S3</td>\n",
336
+ " <td>-</td>\n",
337
+ " <td>-</td>\n",
338
+ " <td>ports/esp32/boards/ESP32_GENERIC_S3/mpconfigbo...</td>\n",
339
+ " <td>v1.22.2</td>\n",
340
+ " </tr>\n",
341
+ " </tbody>\n",
342
+ "</table>\n",
343
+ "</div>"
344
+ ],
345
+ "text/plain": [
346
+ " description port board \\\n",
347
+ "354 ESP32-D2WD esp32 ESP32_GENERIC \n",
348
+ "364 ESP32-UNICORE esp32 ESP32_GENERIC \n",
349
+ "370 ESP32C3 module with ESP32C3 esp32 ESP32_GENERIC_C3 \n",
350
+ "602 Generic ESP32 module with ESP32 esp32 ESP32_GENERIC \n",
351
+ "608 Generic ESP32 module with OTA esp32 ESP32_GENERIC \n",
352
+ "614 Generic ESP32 module with SPIRAM esp32 ESP32_GENERIC \n",
353
+ "630 Generic ESP32S2 module with ESP32S2 esp32 ESP32_GENERIC_S2 \n",
354
+ "636 Generic ESP32S3 module with ESP32S3 esp32 ESP32_GENERIC_S3 \n",
355
+ "642 Generic ESP32S3 module with Octal-SPIRAM esp32 ESP32_GENERIC_S3 \n",
356
+ "\n",
357
+ " board_name mcu_name \\\n",
358
+ "354 - - \n",
359
+ "364 - - \n",
360
+ "370 ESP32C3 module ESP32C3 \n",
361
+ "602 Generic ESP32 module ESP32 \n",
362
+ "608 - - \n",
363
+ "614 - - \n",
364
+ "630 Generic ESP32S2 module ESP32S2 \n",
365
+ "636 Generic ESP32S3 module ESP32S3 \n",
366
+ "642 - - \n",
367
+ "\n",
368
+ " path version \n",
369
+ "354 ports/esp32/boards/ESP32_GENERIC/mpconfigboard... v1.22.2 \n",
370
+ "364 ports/esp32/boards/ESP32_GENERIC/mpconfigboard... v1.22.2 \n",
371
+ "370 ports/esp32/boards/ESP32_GENERIC_C3/mpconfigbo... v1.22.2 \n",
372
+ "602 ports/esp32/boards/ESP32_GENERIC/mpconfigboard.h v1.22.2 \n",
373
+ "608 ports/esp32/boards/ESP32_GENERIC/mpconfigboard... v1.22.2 \n",
374
+ "614 ports/esp32/boards/ESP32_GENERIC/mpconfigboard... v1.22.2 \n",
375
+ "630 ports/esp32/boards/ESP32_GENERIC_S2/mpconfigbo... v1.22.2 \n",
376
+ "636 ports/esp32/boards/ESP32_GENERIC_S3/mpconfigbo... v1.22.2 \n",
377
+ "642 ports/esp32/boards/ESP32_GENERIC_S3/mpconfigbo... v1.22.2 "
378
+ ]
379
+ },
380
+ "execution_count": 12,
381
+ "metadata": {},
382
+ "output_type": "execute_result"
383
+ }
384
+ ],
385
+ "source": [
386
+ "generics = df[(df[\"board\"].str.contains(\"GENERIC\")) & (df[\"version\"] == \"v1.22.2\") & (df[\"port\"] == \"esp32\")]\n",
387
+ "\n",
388
+ "generics\n"
389
+ ]
390
+ },
391
+ {
392
+ "cell_type": "code",
393
+ "execution_count": null,
394
+ "metadata": {},
395
+ "outputs": [],
396
+ "source": []
397
+ }
398
+ ],
399
+ "metadata": {
400
+ "language_info": {
401
+ "name": "python"
402
+ }
403
+ },
404
+ "nbformat": 4,
405
+ "nbformat_minor": 2
406
+ }
mpflash/uf2disk.py ADDED
@@ -0,0 +1,12 @@
1
+ """Info to support mounting and unmounting of UF2 drives on linux and macos"""
2
+
3
+
4
+ class UF2Disk:
5
+ """Info to support mounting and unmounting of UF2 drives on linux"""
6
+
7
+ device_path: str
8
+ label: str
9
+ mountpoint: str
10
+
11
+ def __repr__(self):
12
+ return repr(self.__dict__)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mpflash
3
- Version: 0.7.6
3
+ Version: 0.7.7
4
4
  Summary: Flash and download tool for MicroPython firmwares
5
5
  Home-page: https://github.com/Josverl/micropython-stubber/blob/main/src/mpflash/README.md
6
6
  License: MIT
@@ -22,6 +22,7 @@ Requires-Dist: blkinfo (>=0.2.0,<0.3.0)
22
22
  Requires-Dist: esptool (>=4.7.0,<5.0.0)
23
23
  Requires-Dist: inquirer (>=3.2.4,<4.0.0)
24
24
  Requires-Dist: jsonlines (>=4.0.0,<5.0.0)
25
+ Requires-Dist: jsons (>=1.6.3,<2.0.0)
25
26
  Requires-Dist: libusb (>=1.0.27,<2.0.0) ; sys_platform == "win32"
26
27
  Requires-Dist: loguru (>=0.7.2,<0.8.0)
27
28
  Requires-Dist: mpremote (>=1.22.0,<2.0.0)
@@ -2,11 +2,11 @@ mpflash/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  mpflash/ask_input.py,sha256=XxYbO2DwB59pyv1uec9fN7nDxQcHLPnp55LSU8eOMg8,9459
3
3
  mpflash/cli_download.py,sha256=YHoQOaY5Cg0-jKkEHNa9jvlTr9AfVw9xNm33eWahfdI,3623
4
4
  mpflash/cli_flash.py,sha256=yh8JH88LduSRW0gUvCpTUVmY6PaojciPZeEdHqtxq6M,6133
5
- mpflash/cli_group.py,sha256=nL3H06PHm_XUDlMuRyjgmTYeLnkrLa9mKDdahYw-KRo,1967
5
+ mpflash/cli_group.py,sha256=g1lk8uEqisaIaWwJMxw_oOaB1twodrgGPmt6qcCEDDA,2424
6
6
  mpflash/cli_list.py,sha256=KIlEeqcIIBf0g-emS43fzKspUy6fn9TUuFl0u00XaK8,1024
7
7
  mpflash/cli_main.py,sha256=GJzA4_WTiwAzQP0b2tCXwfyNId1TeBnrzU1GP5xZans,796
8
8
  mpflash/common.py,sha256=lucFGMLl03qz-5Ic2XVv4g5XVt6hloUU6N5v0tSaUYE,1049
9
- mpflash/config.py,sha256=G6TxliEGxoYXy1SHQYBKgywnKccz9QzD3mGq_Vv1frg,419
9
+ mpflash/config.py,sha256=hBc1Hf4XQ0YIoeiPBbannnqDg0C7226Y7Vu8o4jUkBQ,495
10
10
  mpflash/download.py,sha256=HMYpLVIcy_FaZGHIuucsmJ4fceYhf5DFJgG8f7r-mcA,11120
11
11
  mpflash/downloaded.py,sha256=ADMJqZn7WVcU-Rm2X6RqA8ejtBNBYXcpwxVyT3v7r6s,3803
12
12
  mpflash/errors.py,sha256=Q5LR12Wo8iUCg5n_qq4GjdBdBflbvCOdKsRJ5InYRfI,96
@@ -15,9 +15,10 @@ mpflash/flash_esp.py,sha256=1_jtZnmJl_aGznJZR1X9N2sK7ys8s_3N21LWllRB-lI,2314
15
15
  mpflash/flash_stm32.py,sha256=d4BoQl3a9Tchnvn2ZTuq2MpYBB4MTaRukwtEncI95k0,823
16
16
  mpflash/flash_stm32_cube.py,sha256=w7aGWjReeWUKl0Q3ZjXH8BRqNO1Tk9AO7gtRNUg1c9Y,3970
17
17
  mpflash/flash_stm32_dfu.py,sha256=G70EZodWb-aRi507Jxbys-VEwbBGU1oZacow3_nq-d4,2972
18
- mpflash/flash_uf2.py,sha256=ps2gUXZ4bdsgMqQzveYLLoXOmSC-aCmIG9L_tJjQ7Sk,2115
18
+ mpflash/flash_uf2.py,sha256=JiAHiXHL5QkvS-qNeehKJW9PaTQI9IsfsqrED7jwmAA,2441
19
19
  mpflash/flash_uf2_boardid.py,sha256=WZKucGu_hJ8ymb236uuZbiR6pD6AA_l4LA-7LwtQhq8,414
20
- mpflash/flash_uf2_linux.py,sha256=jMnoW-Mmj33RJFQkqQMs9iKmAAtH4QoD7gYGztkvhH8,4319
20
+ mpflash/flash_uf2_linux.py,sha256=T4TaA7vqEXz3_RdAWrgQ2IBpWYPF4FW-I2eCiKoTqHI,4049
21
+ mpflash/flash_uf2_macos.py,sha256=kX9uMZM6uLFWvRM7p8Qzqp-2MPBJTUFNgdPVwn81fLA,2740
21
22
  mpflash/flash_uf2_windows.py,sha256=94YoO2UIzfyJs4CPJ9sjG_WY26SX8aUPl9mf9R9W5xk,1093
22
23
  mpflash/list.py,sha256=IpDhYrr5dXWY88PiKkvhqt3ioNF9tlsakTZVD05YBfQ,4713
23
24
  mpflash/logger.py,sha256=dI_H_a7EOdQJyvoeRHQuYeZuTKYVUS3DUPTLhE9rkdM,1098
@@ -25,16 +26,18 @@ mpflash/mpboard_id/__init__.py,sha256=LT52MV3tIHgBu_bFdvae2csahzonsCwno2ardU5ivs
25
26
  mpflash/mpboard_id/board_id.py,sha256=vGPfxMVmQCBRlsZJAhsbhZStlDl21zLC0sqXcaBrSXc,2592
26
27
  mpflash/mpboard_id/board_info.csv,sha256=KPWDo-zHWfrPGQn9oInsDH-5IdCzhBCs6K_YAmqqSpQ,96983
27
28
  mpflash/mpboard_id/board_info.json,sha256=JtVyOMIO1O7vLKzJ0hyXQ4JSxXiQBJyay2hjdNLnZM0,674442
29
+ mpflash/mpboard_id/Untitled-1.ipynb,sha256=Zph4q5abgn4CbhMr_n-rQLXskqsbqpAKHApJdoklCCc,15759
28
30
  mpflash/mpremoteboard/__init__.py,sha256=fJ_N1F6R3CfP9F7pmocb5l8yRvzmSmtHi4u_uTQHR1w,7683
29
31
  mpflash/mpremoteboard/mpy_fw_info.py,sha256=6AQbN3jtQgllqWQYl4e-63KeEtV08EXk8_JnM6XBkvo,4554
30
32
  mpflash/mpremoteboard/runner.py,sha256=-PgzAeBGbyXaAUlwyiw4mcINsP2U1XRRjP1_QdBrxpg,4786
33
+ mpflash/uf2disk.py,sha256=4_P2l-kedM7VSliA2u706LQLxvu3xWSod1-lj-xjZis,298
31
34
  mpflash/vendor/dfu.py,sha256=oK_MRSOyDJrUuS6D24IMIsfL7oLcrvUq0yp_h4WIY2U,5739
32
35
  mpflash/vendor/pydfu.py,sha256=_MdBRo1EeNeKDqFPSTB5tNL1jGSBJgsVeVjE5e7Pb8s,20542
33
36
  mpflash/vendor/readme.md,sha256=iIIZxuLUIGHQ0KODzYVtMezsztvyxCXcNJp_AzwTIPk,86
34
37
  mpflash/vendor/versions.py,sha256=ooRZjeeYepQHwp12hMu2m0p8nZXQ5s942w5mGkKmgeI,3629
35
38
  mpflash/worklist.py,sha256=izHCPR39OYMXydXpLjtjsgaYlNAfrlQz0_joDPmhDJM,5297
36
- mpflash-0.7.6.dist-info/entry_points.txt,sha256=Jk_visOhYOsZIcSP2Ms9hKqfKy1iorR-6dYltSoWCpY,52
37
- mpflash-0.7.6.dist-info/LICENSE,sha256=mWpNhsIxWzetYNnTpr4eb3HtgsxGIC8KcYWxXEcxQvE,1077
38
- mpflash-0.7.6.dist-info/METADATA,sha256=ci7Uf09buIB9AfiBv5NVsO-LFb__tlkF295aZhTtjyU,14633
39
- mpflash-0.7.6.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
40
- mpflash-0.7.6.dist-info/RECORD,,
39
+ mpflash-0.7.7.dist-info/entry_points.txt,sha256=Jk_visOhYOsZIcSP2Ms9hKqfKy1iorR-6dYltSoWCpY,52
40
+ mpflash-0.7.7.dist-info/LICENSE,sha256=mWpNhsIxWzetYNnTpr4eb3HtgsxGIC8KcYWxXEcxQvE,1077
41
+ mpflash-0.7.7.dist-info/METADATA,sha256=p-95ad85tmmiUz9d3pK-rCifY1mIVV6BAks4YcgmuaE,14671
42
+ mpflash-0.7.7.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
43
+ mpflash-0.7.7.dist-info/RECORD,,