mpflash 1.24.6__py3-none-any.whl → 1.24.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/bootloader/activate.py +1 -1
- mpflash/flash/esp.py +1 -1
- mpflash/flash/uf2/__init__.py +18 -2
- mpflash/mpboard_id/add_boards.py +5 -2
- mpflash/mpboard_id/board_id.py +7 -5
- mpflash/mpboard_id/board_info.zip +0 -0
- mpflash/vendor/pico-universal-flash-nuke/LICENSE.txt +21 -0
- mpflash/vendor/pico-universal-flash-nuke/universal_flash_nuke.uf2 +0 -0
- mpflash/vendor/readme.md +2 -0
- {mpflash-1.24.6.dist-info → mpflash-1.24.7.dist-info}/METADATA +1 -1
- {mpflash-1.24.6.dist-info → mpflash-1.24.7.dist-info}/RECORD +14 -12
- {mpflash-1.24.6.dist-info → mpflash-1.24.7.dist-info}/LICENSE +0 -0
- {mpflash-1.24.6.dist-info → mpflash-1.24.7.dist-info}/WHEEL +0 -0
- {mpflash-1.24.6.dist-info → mpflash-1.24.7.dist-info}/entry_points.txt +0 -0
mpflash/bootloader/activate.py
CHANGED
@@ -12,7 +12,7 @@ from .touch1200 import enter_bootloader_touch_1200bps
|
|
12
12
|
|
13
13
|
BL_OPTIONS = {
|
14
14
|
"stm32": [BootloaderMethod.TOUCH_1200, BootloaderMethod.MPY, BootloaderMethod.MANUAL],
|
15
|
-
"rp2": [BootloaderMethod.
|
15
|
+
"rp2": [BootloaderMethod.MPY, BootloaderMethod.TOUCH_1200, BootloaderMethod.MANUAL],
|
16
16
|
"samd": [BootloaderMethod.TOUCH_1200, BootloaderMethod.MPY, BootloaderMethod.MANUAL],
|
17
17
|
"esp32": [BootloaderMethod.NONE],
|
18
18
|
"esp8266": [BootloaderMethod.NONE],
|
mpflash/flash/esp.py
CHANGED
@@ -15,7 +15,7 @@ from mpflash.mpremoteboard import MPRemoteBoard
|
|
15
15
|
|
16
16
|
|
17
17
|
def flash_esp(mcu: MPRemoteBoard, fw_file: Path, *, erase: bool = True) -> Optional[MPRemoteBoard]:
|
18
|
-
if mcu.port not in ["esp32", "esp8266"] or mcu.board
|
18
|
+
if mcu.port not in ["esp32", "esp8266"] or mcu.board.startswith("ARDUINO_"):
|
19
19
|
log.error(f"esptool not supported for {mcu.port} {mcu.board} on {mcu.serialport}")
|
20
20
|
return None
|
21
21
|
|
mpflash/flash/uf2/__init__.py
CHANGED
@@ -5,6 +5,7 @@ Flash SAMD and RP2 via UF2
|
|
5
5
|
import shutil
|
6
6
|
import sys
|
7
7
|
from pathlib import Path
|
8
|
+
import time
|
8
9
|
from typing import Optional
|
9
10
|
|
10
11
|
import tenacity
|
@@ -38,7 +39,21 @@ def flash_uf2(mcu: MPRemoteBoard, fw_file: Path, erase: bool) -> Optional[MPRemo
|
|
38
39
|
log.error(f"UF2 not supported on {mcu.board} on {mcu.serialport}")
|
39
40
|
return None
|
40
41
|
if erase:
|
41
|
-
|
42
|
+
if mcu.port == "rp2":
|
43
|
+
rp2_erase =Path(__file__).parent.joinpath("../../vendor/pico-universal-flash-nuke/universal_flash_nuke.uf2").resolve()
|
44
|
+
log.info(f"Erasing {mcu.port} with {rp2_erase.name}")
|
45
|
+
# optimistic
|
46
|
+
destination = waitfor_uf2(board_id=mcu.port.upper())
|
47
|
+
if not destination :
|
48
|
+
log.error("Board is not in bootloader mode")
|
49
|
+
return None
|
50
|
+
copy_firmware_to_uf2(rp2_erase, destination)
|
51
|
+
if sys.platform in ["linux"]:
|
52
|
+
dismount_uf2_linux()
|
53
|
+
# allow for MCU restart after erase
|
54
|
+
time.sleep(0.5)
|
55
|
+
else:
|
56
|
+
log.warning(f"Erase not (yet) supported on .UF2, for port {mcu.port}, skipping erase.")
|
42
57
|
|
43
58
|
destination = waitfor_uf2(board_id=mcu.port.upper())
|
44
59
|
|
@@ -84,5 +99,6 @@ def copy_firmware_to_uf2(fw_file: Path, destination: Path):
|
|
84
99
|
Copy the firmware file to the destination,
|
85
100
|
Retry 3 times with 1s delay
|
86
101
|
"""
|
87
|
-
log.
|
102
|
+
log.trace(f"Firmware: {fw_file}")
|
103
|
+
log.info(f"Copying {fw_file.name} to {destination}.")
|
88
104
|
return shutil.copy(fw_file, destination)
|
mpflash/mpboard_id/add_boards.py
CHANGED
@@ -16,7 +16,8 @@ import mpflash.basicgit as git
|
|
16
16
|
from mpflash.logger import log
|
17
17
|
from mpflash.mpboard_id import Board
|
18
18
|
from mpflash.mpboard_id.store import write_boardinfo_json
|
19
|
-
from mpflash.versions import
|
19
|
+
from mpflash.versions import (get_preview_mp_version, get_stable_mp_version,
|
20
|
+
micropython_versions)
|
20
21
|
|
21
22
|
# look for all mpconfigboard.h files and extract the board name
|
22
23
|
# from the #define MICROPY_HW_BOARD_NAME "PYBD_SF6"
|
@@ -47,6 +48,8 @@ def boards_from_repo(mpy_path: Path, version: str, family: Optional[str] = None)
|
|
47
48
|
version = version or git.get_local_tag() # type: ignore
|
48
49
|
if not version:
|
49
50
|
raise ValueError("No version provided and no local tag found.")
|
51
|
+
elif version in ["main", "master"]:
|
52
|
+
version = get_preview_mp_version()
|
50
53
|
|
51
54
|
board_list: List[Board] = []
|
52
55
|
# look in mpconfigboard.h files
|
@@ -231,7 +234,7 @@ def ask_mpy_path():
|
|
231
234
|
inquirer.Text(
|
232
235
|
"mpy_path",
|
233
236
|
message="Enter the path to the MicroPython repository",
|
234
|
-
default="
|
237
|
+
default="./repos/micropython",
|
235
238
|
)
|
236
239
|
]
|
237
240
|
if answers := inquirer.prompt(questions):
|
mpflash/mpboard_id/board_id.py
CHANGED
@@ -9,7 +9,7 @@ from typing import Optional
|
|
9
9
|
from mpflash.errors import MPFlashError
|
10
10
|
from mpflash.logger import log
|
11
11
|
from mpflash.mpboard_id.store import read_known_boardinfo
|
12
|
-
from mpflash.versions import clean_version, get_stable_mp_version
|
12
|
+
from mpflash.versions import clean_version, get_preview_mp_version, get_stable_mp_version
|
13
13
|
|
14
14
|
|
15
15
|
def find_board_id_by_description(
|
@@ -64,13 +64,15 @@ def _find_board_id_by_description(
|
|
64
64
|
short_descr = descr.split(" with ")[0]
|
65
65
|
if version:
|
66
66
|
# filter for matching version
|
67
|
-
if version in ("
|
68
|
-
# match last stable
|
67
|
+
if version in ("stable"):
|
69
68
|
version = get_stable_mp_version()
|
69
|
+
if version in ("preview", "master"):
|
70
|
+
version = get_preview_mp_version()
|
70
71
|
known_versions = sorted({b.version for b in candidate_boards})
|
71
72
|
if version not in known_versions:
|
72
|
-
log.trace(
|
73
|
-
version
|
73
|
+
log.trace(known_versions)
|
74
|
+
log.debug(f"Version {version} not found in board info, using latest stable version {get_stable_mp_version()}")
|
75
|
+
version = ".".join(get_stable_mp_version().split(".")[:2]) # take only major.minor
|
74
76
|
if version_matches := [b for b in candidate_boards if b.version.startswith(version)]:
|
75
77
|
candidate_boards = version_matches
|
76
78
|
else:
|
Binary file
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright 2024 Phil Howard
|
2
|
+
|
3
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
|
4
|
+
following conditions are met:
|
5
|
+
|
6
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
7
|
+
disclaimer.
|
8
|
+
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
|
10
|
+
disclaimer in the documentation and/or other materials provided with the distribution.
|
11
|
+
|
12
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
|
13
|
+
derived from this software without specific prior written permission.
|
14
|
+
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
16
|
+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
17
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
18
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
19
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
20
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
21
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
Binary file
|
mpflash/vendor/readme.md
CHANGED
@@ -3,7 +3,7 @@ mpflash/add_firmware.py,sha256=1h0HsA-EVi3HXLmoEvzwY_a-GuWYzPwulTYHHBB8THg,3428
|
|
3
3
|
mpflash/ask_input.py,sha256=RJHGGrhYniSu-bdoKnKptE3DtpiCREJGRTZmFazvG-E,8946
|
4
4
|
mpflash/basicgit.py,sha256=NO27JTPUsnMWQ2bKI_zsIFsFTfCZO3QKbvQ23kIehxU,10734
|
5
5
|
mpflash/bootloader/__init__.py,sha256=Qy3E6tETPnzMga9LgD5UgOvJ0zZIBEqhtEVb4v8CTWQ,107
|
6
|
-
mpflash/bootloader/activate.py,sha256=
|
6
|
+
mpflash/bootloader/activate.py,sha256=orQOw4XTkXVZI-rMInRb0T5Wp3qA_BlzbJUA2gyBToU,2361
|
7
7
|
mpflash/bootloader/detect.py,sha256=fBrILi7-ICRaregqms3PYqwiQVAJC0rXVhpyzDkoPQI,2690
|
8
8
|
mpflash/bootloader/manual.py,sha256=2IfxrTFRso78FezVMTOrXMEojamFDDTXrAM9g1SbjNA,3170
|
9
9
|
mpflash/bootloader/micropython.py,sha256=v_kZkvg0uWZDbMrT78gmiYHbD83QLdnrctvEClI8iRg,529
|
@@ -20,10 +20,10 @@ mpflash/download.py,sha256=wE4uBSFFMAKOBH4jwHweL0wVYh4vi74t1673ku_IeoA,14305
|
|
20
20
|
mpflash/downloaded.py,sha256=nxTWU4lvhcthqvVmzpYHnXCnjD8wJv0KFq2KtaoTO1A,5160
|
21
21
|
mpflash/errors.py,sha256=IAidY3qkZsXy6Pm1rdmVFmGyg81ywHhse3itaPctA2w,247
|
22
22
|
mpflash/flash/__init__.py,sha256=g4Fp8MiquaDZXIvRJwYRkkll1MMyRud7x6qmwCk9Lgo,2096
|
23
|
-
mpflash/flash/esp.py,sha256=
|
23
|
+
mpflash/flash/esp.py,sha256=CRF8sfIyuDZoYC1luBy92zLm6Qz3dnBBWjuJ3A4_crE,2284
|
24
24
|
mpflash/flash/stm32.py,sha256=dqp9BZ4Vr-6GlQcF12TSmRf-5TXkov9qvCpMgeUJc7Y,574
|
25
25
|
mpflash/flash/stm32_dfu.py,sha256=W-3JsRQyf3DduoIRXDmGZ35RogqtjQgcJnk-GOtQoLE,3090
|
26
|
-
mpflash/flash/uf2/__init__.py,sha256=
|
26
|
+
mpflash/flash/uf2/__init__.py,sha256=haL84hP2p1ZjKF6dXJJHAB_NTf7jT91MuZvmvg9SpIA,3617
|
27
27
|
mpflash/flash/uf2/boardid.py,sha256=U5wGM8VA3wEpUxQCMtuXpMZZomdVH8J_Zd5_GekUMuU,423
|
28
28
|
mpflash/flash/uf2/linux.py,sha256=UgoF_GhJdxA2NvfcFNV69YuDg3v4ueLM0epsDzmfKK0,4440
|
29
29
|
mpflash/flash/uf2/macos.py,sha256=TGGijlnMJy3RDhdPS3WsPOE2lWFOQbqC3xn4cxLu8GA,1229
|
@@ -33,10 +33,10 @@ mpflash/flash/worklist.py,sha256=owS3xJbWC-SzbK9z6jQER0Kat3OIV09IxnV-f-tjGlY,599
|
|
33
33
|
mpflash/list.py,sha256=lP_S5xbC0Men9HsXcIxOsP0bFRlCYh5CynMLFJx8cEE,3607
|
34
34
|
mpflash/logger.py,sha256=dI_H_a7EOdQJyvoeRHQuYeZuTKYVUS3DUPTLhE9rkdM,1098
|
35
35
|
mpflash/mpboard_id/__init__.py,sha256=b9PJiKFqmfyYgfi0-pbWGp2mrljdgvO6DNy0ABS8izU,3898
|
36
|
-
mpflash/mpboard_id/add_boards.py,sha256=
|
36
|
+
mpflash/mpboard_id/add_boards.py,sha256=xBC9DULWq6nR1Nui2Z7tiLHxC0QohPXgJOYvSgrGwEM,10063
|
37
37
|
mpflash/mpboard_id/board.py,sha256=JKb4T67HmK7widW-4c1PgilvywMbZYToLk9Fyokm-6Q,1163
|
38
|
-
mpflash/mpboard_id/board_id.py,sha256=
|
39
|
-
mpflash/mpboard_id/board_info.zip,sha256=
|
38
|
+
mpflash/mpboard_id/board_id.py,sha256=A2os0LU7-i_0JuEcMc1PbLt79TiAq16qRl7fv5uzsA8,3374
|
39
|
+
mpflash/mpboard_id/board_info.zip,sha256=0rQkVLOBRg5dwvkLmJtRdCXwKiA9arkWYVH7N8dYuNw,21720
|
40
40
|
mpflash/mpboard_id/store.py,sha256=n85vnUAxGKv1C23wkm22ZFAFGK6AZZiCFvc1lGJJjis,1703
|
41
41
|
mpflash/mpremoteboard/__init__.py,sha256=Vydc7jZai32lrGTUjwylZT9U8yulsgLIk39mnuI_k9I,9666
|
42
42
|
mpflash/mpremoteboard/mpy_fw_info.py,sha256=eRjhqN7MpmYE9TiS4iukquZZs3QE_lD5zv_vOPSjNrk,4821
|
@@ -44,11 +44,13 @@ mpflash/mpremoteboard/runner.py,sha256=-PgzAeBGbyXaAUlwyiw4mcINsP2U1XRRjP1_QdBrx
|
|
44
44
|
mpflash/vendor/board_database.py,sha256=QE3oXj96oTAsx94gNfHMYWu_RgBTHW1v9Wp5dq_Dt-Q,5253
|
45
45
|
mpflash/vendor/click_aliases.py,sha256=c853EHSlkE2DvFqeFvFpwXKuJj3_jsXDP7iotVOKaAw,3156
|
46
46
|
mpflash/vendor/dfu.py,sha256=ZXMcE6aH4-43Wh4tbQT4U-q-BU3RUiL3JAxmP_QAK2s,5755
|
47
|
+
mpflash/vendor/pico-universal-flash-nuke/LICENSE.txt,sha256=Zkc2iTNbib2NCMwtLjMEz0vFCPglgvaw6Mj7QiWldpQ,1484
|
48
|
+
mpflash/vendor/pico-universal-flash-nuke/universal_flash_nuke.uf2,sha256=QuPMppqHMVOt3vDVU0bikHRLsTiDRQYNUcGQ_OLRFGI,28160
|
47
49
|
mpflash/vendor/pydfu.py,sha256=_MdBRo1EeNeKDqFPSTB5tNL1jGSBJgsVeVjE5e7Pb8s,20542
|
48
|
-
mpflash/vendor/readme.md,sha256=
|
50
|
+
mpflash/vendor/readme.md,sha256=BQ7Uxf8joeYMjTUuSLLBG49ob6a9MgFPIEwuc72-Mfw,415
|
49
51
|
mpflash/versions.py,sha256=qGkE2LTzQ1QDyHc9-wzsHsRrN7PWK69xt0Vq3EVojms,4452
|
50
|
-
mpflash-1.24.
|
51
|
-
mpflash-1.24.
|
52
|
-
mpflash-1.24.
|
53
|
-
mpflash-1.24.
|
54
|
-
mpflash-1.24.
|
52
|
+
mpflash-1.24.7.dist-info/entry_points.txt,sha256=Jk_visOhYOsZIcSP2Ms9hKqfKy1iorR-6dYltSoWCpY,52
|
53
|
+
mpflash-1.24.7.dist-info/LICENSE,sha256=mWpNhsIxWzetYNnTpr4eb3HtgsxGIC8KcYWxXEcxQvE,1077
|
54
|
+
mpflash-1.24.7.dist-info/METADATA,sha256=kkeoaVrJt6i62yFsvXWdczncaJ3bz3055X05Ijt6z-g,17757
|
55
|
+
mpflash-1.24.7.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
56
|
+
mpflash-1.24.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|