micropython-stubber 1.23.0__py3-none-any.whl → 1.23.1__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.
Files changed (82) hide show
  1. {micropython_stubber-1.23.0.dist-info → micropython_stubber-1.23.1.dist-info}/METADATA +4 -3
  2. {micropython_stubber-1.23.0.dist-info → micropython_stubber-1.23.1.dist-info}/RECORD +80 -80
  3. mpflash/README.md +14 -4
  4. mpflash/mpflash/add_firmware.py +1 -1
  5. mpflash/mpflash/ask_input.py +1 -1
  6. {stubber → mpflash/mpflash}/basicgit.py +3 -13
  7. mpflash/mpflash/bootloader/__init__.py +2 -37
  8. mpflash/mpflash/bootloader/activate.py +60 -0
  9. mpflash/mpflash/bootloader/detect.py +82 -0
  10. mpflash/mpflash/bootloader/manual.py +10 -11
  11. mpflash/mpflash/bootloader/micropython.py +2 -0
  12. mpflash/mpflash/bootloader/touch1200.py +13 -22
  13. mpflash/mpflash/cli_download.py +1 -1
  14. mpflash/mpflash/cli_flash.py +3 -3
  15. mpflash/mpflash/cli_group.py +18 -5
  16. mpflash/mpflash/cli_main.py +3 -5
  17. mpflash/mpflash/common.py +1 -0
  18. mpflash/mpflash/config.py +2 -1
  19. mpflash/mpflash/connected.py +9 -5
  20. mpflash/mpflash/download.py +9 -5
  21. mpflash/mpflash/downloaded.py +1 -1
  22. mpflash/mpflash/{flash.py → flash/__init__.py} +3 -3
  23. mpflash/mpflash/{flash_esp.py → flash/esp.py} +1 -1
  24. mpflash/mpflash/{flash_stm32.py → flash/stm32.py} +4 -3
  25. mpflash/mpflash/{flash_stm32_dfu.py → flash/stm32_dfu.py} +1 -1
  26. mpflash/mpflash/{flash_uf2.py → flash/uf2/__init__.py} +19 -20
  27. mpflash/mpflash/{flash_uf2_linux.py → flash/uf2/linux.py} +12 -11
  28. mpflash/mpflash/{flash_uf2_macos.py → flash/uf2/macos.py} +11 -6
  29. mpflash/mpflash/{flash_uf2_windows.py → flash/uf2/windows.py} +11 -6
  30. mpflash/mpflash/{worklist.py → flash/worklist.py} +8 -9
  31. mpflash/mpflash/list.py +13 -3
  32. mpflash/mpflash/mpboard_id/__init__.py +1 -1
  33. mpflash/mpflash/mpboard_id/add_boards.py +3 -7
  34. mpflash/mpflash/mpboard_id/board_id.py +1 -1
  35. mpflash/mpflash/mpremoteboard/__init__.py +7 -11
  36. {stubber/utils → mpflash/mpflash}/versions.py +31 -24
  37. mpflash/poetry.lock +16 -5
  38. mpflash/pyproject.toml +4 -3
  39. stubber/__init__.py +1 -1
  40. stubber/board/createstubs.py +4 -4
  41. stubber/board/createstubs_db.py +5 -5
  42. stubber/board/createstubs_db_min.py +1 -1
  43. stubber/board/createstubs_db_mpy.mpy +0 -0
  44. stubber/board/createstubs_mem.py +5 -5
  45. stubber/board/createstubs_mem_min.py +1 -1
  46. stubber/board/createstubs_mem_mpy.mpy +0 -0
  47. stubber/board/createstubs_min.py +1 -1
  48. stubber/board/createstubs_mpy.mpy +0 -0
  49. stubber/codemod/utils.py +2 -3
  50. stubber/commands/cli.py +1 -1
  51. stubber/commands/clone_cmd.py +2 -1
  52. stubber/commands/get_docstubs_cmd.py +1 -1
  53. stubber/commands/get_frozen_cmd.py +1 -1
  54. stubber/commands/get_mcu_cmd.py +1 -1
  55. stubber/commands/merge_cmd.py +1 -2
  56. stubber/commands/publish_cmd.py +1 -2
  57. stubber/commands/switch_cmd.py +2 -2
  58. stubber/commands/variants_cmd.py +1 -2
  59. stubber/freeze/get_frozen.py +1 -1
  60. stubber/minify.py +4 -3
  61. stubber/publish/candidates.py +4 -10
  62. stubber/publish/defaults.py +4 -9
  63. stubber/publish/missing_class_methods.py +1 -1
  64. stubber/publish/package.py +1 -1
  65. stubber/publish/pathnames.py +1 -1
  66. stubber/publish/publish.py +1 -1
  67. stubber/publish/stubpackage.py +3 -5
  68. stubber/rst/reader.py +5 -13
  69. stubber/tools/manifestfile.py +0 -1
  70. stubber/update_fallback.py +1 -1
  71. stubber/utils/__init__.py +2 -1
  72. stubber/utils/config.py +3 -5
  73. stubber/utils/manifest.py +2 -4
  74. stubber/utils/repos.py +5 -12
  75. mpflash/mpflash/flash_stm32_cube.py +0 -111
  76. mpflash/mpflash/vendor/versions.py +0 -119
  77. {micropython_stubber-1.23.0.dist-info → micropython_stubber-1.23.1.dist-info}/LICENSE +0 -0
  78. {micropython_stubber-1.23.0.dist-info → micropython_stubber-1.23.1.dist-info}/WHEEL +0 -0
  79. {micropython_stubber-1.23.0.dist-info → micropython_stubber-1.23.1.dist-info}/entry_points.txt +0 -0
  80. /mpflash/{mpflash/vendor/basicgit.py → basicgit.py} +0 -0
  81. /mpflash/mpflash/{flash_uf2_boardid.py → flash/uf2/boardid.py} +0 -0
  82. /mpflash/mpflash/{uf2disk.py → flash/uf2/uf2disk.py} +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: micropython-stubber
3
- Version: 1.23.0
3
+ Version: 1.23.1
4
4
  Summary: Tooling to create and maintain stubs for MicroPython
5
5
  Home-page: https://github.com/Josverl/micropython-stubber#readme
6
6
  License: MIT
@@ -26,7 +26,7 @@ Requires-Dist: executing (>=2.0.1,<3.0.0)
26
26
  Requires-Dist: importlib-metadata (>=1.0,<2.0) ; python_version < "3.8"
27
27
  Requires-Dist: libcst (>=1.1.0,<2.0.0)
28
28
  Requires-Dist: loguru (>=0.6,<0.8)
29
- Requires-Dist: mpflash (>=0.8.6,<0.9.0)
29
+ Requires-Dist: mpflash (==0.9.1.post2)
30
30
  Requires-Dist: mpremote (>=1.23.0,<2.0.0)
31
31
  Requires-Dist: mypy (==1.9.0)
32
32
  Requires-Dist: mypy-gitlab-code-quality (>=1.1.0,<2.0.0)
@@ -38,13 +38,14 @@ Requires-Dist: pyright (>=1.1.341,<2.0.0)
38
38
  Requires-Dist: pyserial (>=3.5,<4.0)
39
39
  Requires-Dist: pysondb-v2 (>=2.1.0,<3.0.0)
40
40
  Requires-Dist: python-minifier (>=2.7.0,<3.0.0) ; python_version < "3.12"
41
- Requires-Dist: requests (>=2.28.0,<3.0.0)
41
+ Requires-Dist: requests (>=2.32.3,<3.0.0)
42
42
  Requires-Dist: rich-click (>=1.8.3,<2.0.0)
43
43
  Requires-Dist: tabulate (>=0.9.0,<0.10.0)
44
44
  Requires-Dist: tenacity (>=8.2.2,<9.0.0)
45
45
  Requires-Dist: tomli (>=2.0.1,<3.0.0) ; python_version < "3.11"
46
46
  Requires-Dist: tomli-w (>=1.0.0,<2.0.0)
47
47
  Requires-Dist: typed-config (>=1.3.0,<2.0.0)
48
+ Requires-Dist: urllib3 (>=2.2.2,<3.0.0)
48
49
  Project-URL: Documentation, https://micropython-stubber.readthedocs.io/
49
50
  Project-URL: Repository, https://github.com/Josverl/micropython-stubber
50
51
  Description-Content-Type: text/markdown
@@ -1,71 +1,72 @@
1
- mpflash/README.md,sha256=hV89fJ3UfE-6CpugGT_SI7I_V6vtCf5GVfzUK3POjd4,13496
1
+ mpflash/README.md,sha256=cajL2pq_Fjt7G7cOHp1_uDTf5jmOf6iQwOIvg2X5AJ0,14233
2
+ mpflash/basicgit.py,sha256=b6-gdK_DT0dmW3jEY9T0cjKR-TSEQOSl9U9sRcJh538,9257
2
3
  mpflash/libusb_flash.ipynb,sha256=sw5MVQvPmH-DJy9kOdXyO80BSjEPMEXf_GJsGk3usrc,6428
3
4
  mpflash/mpflash/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- mpflash/mpflash/add_firmware.py,sha256=QXk9P1UC0xvDlWhJ3Kj-Acy2wuxxK7R0L61KKiAjk1U,3337
5
- mpflash/mpflash/ask_input.py,sha256=GGyOOlzpvhYmxyILVuNSj7hJlAvpPFXpP95erinTyCs,8717
6
- mpflash/mpflash/bootloader/__init__.py,sha256=AbZJVbubvgcV0bQtItS9PEAvvPOKWLZpgi8DX5a5f5A,1282
7
- mpflash/mpflash/bootloader/manual.py,sha256=tebIE2YBYvsWx2YmAcUcWnTnSjCqR1AwkXKVHJvnQkA,3002
8
- mpflash/mpflash/bootloader/micropython.py,sha256=of9OuCchiGoczXPi6i0NT9LZHB9FgvigtZxWWvAcb2Q,399
9
- mpflash/mpflash/bootloader/touch1200.py,sha256=D9yB1n2bSR-nyQDdQXJtCsNknSfHhI6hRziBqOv_HJI,1466
10
- mpflash/mpflash/cli_download.py,sha256=qKZzHmuHazw5fhj_EGDu4DsqYCan41BK99nk1YWELFE,3527
11
- mpflash/mpflash/cli_flash.py,sha256=IQfloZM1UK4VO4bo-8OxQkwH-RTGUFs7IWb-m4gFJJg,7136
12
- mpflash/mpflash/cli_group.py,sha256=s180-nyUVNEwA5bPlkIum4mZPEW0Udf6oBAElnrjsvQ,2236
5
+ mpflash/mpflash/add_firmware.py,sha256=h-Nu9AnXO6ug2CurmgLoUVG1gNy6CA1NjwQl1nUoMZ4,3330
6
+ mpflash/mpflash/ask_input.py,sha256=EsPPlPS_wLC8j9f4o68yKIcqex0dV5tRH7k3rP3spG0,8710
7
+ mpflash/mpflash/basicgit.py,sha256=r_bI2U6QYFiS8ypUd6KtrjyZjK4JCANyK80L6wEzFoU,9213
8
+ mpflash/mpflash/bootloader/__init__.py,sha256=cRIxVRtUc4jZAgtFggRNhEn0BW-9WFpzm5xRy5B4B2U,105
9
+ mpflash/mpflash/bootloader/activate.py,sha256=sN2YuIuFGjLBd_PdG6P3N1yLuLyjnsVWDksrTMhzr_M,2301
10
+ mpflash/mpflash/bootloader/detect.py,sha256=eXL_JPcowb8g0tpZmj9DQXYbpfZFoSrzq86lScKhkT4,2608
11
+ mpflash/mpflash/bootloader/manual.py,sha256=qGInguhYil4v8EkUxPFlxzvs3m__KraPAj3LAKbV1Ts,3069
12
+ mpflash/mpflash/bootloader/micropython.py,sha256=0KDrfdZPtK7fLaxh-_4VxSO-u4IUj7qCyNVw9-LQ74M,517
13
+ mpflash/mpflash/bootloader/touch1200.py,sha256=tL2H4ERh0-YSdR8_v6aK_pDRPMjMevHWUGq4-TTFcWo,1083
14
+ mpflash/mpflash/cli_download.py,sha256=Ip5HViXCVAiG88XgJ3Lg_hhBGIF5DKFTNpL-_gQkdV0,3520
15
+ mpflash/mpflash/cli_flash.py,sha256=KFuJRNgOZ62m70I_KqxqLfLE69b4bOCj69MOfIWdZRo,7136
16
+ mpflash/mpflash/cli_group.py,sha256=JFBtp4qhakJeQkuupEoObHeSFke8eWIU1HjnOZ-JfH0,2504
13
17
  mpflash/mpflash/cli_list.py,sha256=AvYq5_Z7l0Z4rkbr23TwFNzstuZsQgopFpdcrTLwUvs,1965
14
- mpflash/mpflash/cli_main.py,sha256=mOkwtRAxiyZsgiG1QVQ71OaO4kL0D0REEkh-VMieC8E,1107
15
- mpflash/mpflash/common.py,sha256=ZfJR8dKKUy4VDZUgnDTILzuaem2o1Ix2haLxHQ47Z0o,5765
16
- mpflash/mpflash/config.py,sha256=7-IL4R9oHeSh0jO-hppw8pDv990nEI31dwBzZFD50eY,1007
17
- mpflash/mpflash/connected.py,sha256=vzQ6heV7w5Mnu76nR2dr9FiQ7Ja1x1Q_k0TGgdV1lT8,2955
18
- mpflash/mpflash/download.py,sha256=EL17R88QO4TaiX-80GjjlEd6CNZ0vDOcWPuwewZ0_zs,13875
19
- mpflash/mpflash/downloaded.py,sha256=n2iSVv3pS6rZmUr5ry8tOh-jSCZJdI-g_QJG8N5R1As,4815
18
+ mpflash/mpflash/cli_main.py,sha256=cElgh8Soq3U5TEAvrrD1sj7NDi-Eb-pei3QcMI0tlwE,1094
19
+ mpflash/mpflash/common.py,sha256=h4pVuOpopn5oIy5NQdbggtOOktTL_c92cS_oUfPG4v8,5783
20
+ mpflash/mpflash/config.py,sha256=h2Oq7kSe40tOnglpo02wkpaPHxHNVqyB3uGxreIu57U,1029
21
+ mpflash/mpflash/connected.py,sha256=p6RMix-tFr0pfT9TErh0LD1nm24ApTr3CqVGcrnDHk8,3024
22
+ mpflash/mpflash/download.py,sha256=mckR3pdMFQMYBKNmKBEJm9bJnTtQEnkuQ1vWYXcRRv8,13941
23
+ mpflash/mpflash/downloaded.py,sha256=YPN0LDf8DSDvdB9gbVny61bvaJHIDbUs81XUwftTb1c,4808
20
24
  mpflash/mpflash/errors.py,sha256=6lUhVtECY3syV2bBGKzegGH4pPKXhevvhYQZd74sy6o,238
21
- mpflash/mpflash/flash.py,sha256=aC1z4Jq8b8a8O6rCTX1gdGcO5yM1vGoWlZGIWgKuHro,2059
22
- mpflash/mpflash/flash_esp.py,sha256=j-VdSAKzNQZRVVO7oM9NcRAJWPDHsUianOien8rnYE8,2252
23
- mpflash/mpflash/flash_stm32.py,sha256=JNY1bL-VNlnaQ6AhY9drKj8EgwpGwty0WAH1JD-Ecfs,584
24
- mpflash/mpflash/flash_stm32_cube.py,sha256=TnLNqmJcdwRXWj_t0W4o-NmwBjd3z94qpjuyz77oP9o,3859
25
- mpflash/mpflash/flash_stm32_dfu.py,sha256=GUJTU6bmxu4m9cK_wQKRCXPKSIf7F8BAxKMSDs59TwQ,2985
26
- mpflash/mpflash/flash_uf2.py,sha256=f9CwUaBwnmgO9q7I5-Psbd0cStxyeiu0XDcu_OHlmVc,2796
27
- mpflash/mpflash/flash_uf2_boardid.py,sha256=2s4K3QiKWK5HKFKWYsDV3hI8alfWSxEOMeurER3eZtM,408
28
- mpflash/mpflash/flash_uf2_linux.py,sha256=I6KYbLrnn6lFvzoG-LFETak86VHuMG3XKpdrjCGH2co,3945
29
- mpflash/mpflash/flash_uf2_macos.py,sha256=HqQ2HjXlTYzCC5DzjNaoCOR4QKKi5UzjqJcfZVJLaKM,998
30
- mpflash/mpflash/flash_uf2_windows.py,sha256=Pg2siQENEqLddM7KKl9PdXtP7HzBsPICxo8uVCgn57E,1050
31
- mpflash/mpflash/list.py,sha256=pSV9WJozObPSnW-oYs2JPdmh2PtCPJUNgvrozclpnU4,2874
25
+ mpflash/mpflash/flash/__init__.py,sha256=xX2ZJGNX9xpX2s8V7SEJ1It7eOEbl8WkdFzpRd3TLzk,2041
26
+ mpflash/mpflash/flash/esp.py,sha256=LcOgjpE4zmPawHNwSd_6WFkaIYYazA__rf3ihGXR7I0,2228
27
+ mpflash/mpflash/flash/stm32.py,sha256=W8SJ2_8FGXyMS6cRcZpfOvOM8iOC_cn4vK8xd8tKzI4,555
28
+ mpflash/mpflash/flash/stm32_dfu.py,sha256=uTn06H0ZezzCv5O0hvry8ohBtuZXHe_GX2zNUfCxu58,2986
29
+ mpflash/mpflash/flash/uf2/__init__.py,sha256=PWEVxzZEca3pfLx_Qy5c4zlHH4W5fAjd0BmDTkS7s6g,2766
30
+ mpflash/mpflash/flash/uf2/boardid.py,sha256=2s4K3QiKWK5HKFKWYsDV3hI8alfWSxEOMeurER3eZtM,408
31
+ mpflash/mpflash/flash/uf2/linux.py,sha256=4azbcx_YqLZ3RyYNWljejHG_Y6SU-wREL8hhkTYqCjI,4099
32
+ mpflash/mpflash/flash/uf2/macos.py,sha256=sncXJsc2FVfm9rvLDjcEu7ZIyrDeHmazHiNQTUaf1Y0,1187
33
+ mpflash/mpflash/flash/uf2/uf2disk.py,sha256=dQ8_U6e3qkFOyfXZDpWAsvEBIlMr-ZzLkzTDD8SADqM,286
34
+ mpflash/mpflash/flash/uf2/windows.py,sha256=k9Yv71YswPnLx-Z5rf4KjhtVkEWr8SU8EXpeRv87h3A,1290
35
+ mpflash/mpflash/flash/worklist.py,sha256=1uBvn-T35Oey04g6xxNxo5t68q5_tp18eZcRAamF0tY,5828
36
+ mpflash/mpflash/list.py,sha256=O0tX4BvclmDMnnjMxCN9Zh8hdL6vnuvS9pLNxYLBya8,3112
32
37
  mpflash/mpflash/logger.py,sha256=BAVrSXMGZLfSDRFbtVBtvb7Rl0sTJxooCgBS5t-6bXo,1057
33
- mpflash/mpflash/mpboard_id/__init__.py,sha256=yeSWAP1YJWYWB2i8KZlBK1l8loJRcDo-xdymuCv92nU,3723
34
- mpflash/mpflash/mpboard_id/add_boards.py,sha256=JgSXbK9aKtrSWQMIMYYW9OivuWXb1LLTIAmRthi1FC8,9429
38
+ mpflash/mpflash/mpboard_id/__init__.py,sha256=rQrPCN30GP-lfB2a2deA-lQ6iKvaKPK_xbtBoIavGsM,3716
39
+ mpflash/mpflash/mpboard_id/add_boards.py,sha256=ehQn560S0XxAD3nsUMo4o_f6w8XTVAfO0GCnfTKa6-4,9379
35
40
  mpflash/mpflash/mpboard_id/board.py,sha256=yQ8IDHQS09AelvTvmPhpmsL4oX3L7IXGqHorkxDOkoE,1114
36
- mpflash/mpflash/mpboard_id/board_id.py,sha256=G5s-kMKAD-LGUAuU5eYnq25-MGIQPyB-zJojjcGawa4,2878
41
+ mpflash/mpflash/mpboard_id/board_id.py,sha256=wzGrxJu_ciOVT7n2861lhoKmPAjh1QjWnAdfcqNUUqc,2871
37
42
  mpflash/mpflash/mpboard_id/board_info.zip,sha256=F6YowS96DAqjten4ySe4MXgZwPtE-saZOUfY5OQkqKk,19759
38
43
  mpflash/mpflash/mpboard_id/store.py,sha256=lQQgHSxcaM_ZURcfZNSUv3-ZJjUKMC_xEOOSdpzVvBU,1493
39
- mpflash/mpflash/mpremoteboard/__init__.py,sha256=j-Cex6TlihDp125gjGB01S_zE9nIq4mdRfamWjnOJoA,7549
44
+ mpflash/mpflash/mpremoteboard/__init__.py,sha256=7uI-5HJgNsQz_EOCW3cRy2xtqXKt9kX51gDSx6HC0Kc,7522
40
45
  mpflash/mpflash/mpremoteboard/mpy_fw_info.py,sha256=BTupe4rZDTs3UHRqvs429XqWHCchSpwa05yACOiOt5U,4413
41
46
  mpflash/mpflash/mpremoteboard/runner.py,sha256=YUmo5Y0aOgMaww8CXSdNdgXD-wRKncILuMZ0OB_2qRU,4646
42
- mpflash/mpflash/uf2disk.py,sha256=dQ8_U6e3qkFOyfXZDpWAsvEBIlMr-ZzLkzTDD8SADqM,286
43
- mpflash/mpflash/vendor/basicgit.py,sha256=b6-gdK_DT0dmW3jEY9T0cjKR-TSEQOSl9U9sRcJh538,9257
44
47
  mpflash/mpflash/vendor/click_aliases.py,sha256=K98inhtze8td1dw312kexJS7OX_0ojlptPQ5Z0SHxJY,3065
45
48
  mpflash/mpflash/vendor/dfu.py,sha256=jGsiD3lbSV1Ar9qJubhoY_hy-L8FI-K55aow8vgwoYQ,5590
46
49
  mpflash/mpflash/vendor/pydfu.py,sha256=1ObubGsPFrQ7T9M3JRlIPNIG2xx8uYffaEe0Y6bdf_g,19937
47
50
  mpflash/mpflash/vendor/readme.md,sha256=ZVg7kuUYyXcWcrWkaSJ0CunwebCqu2SiS2sqDadwrT8,84
48
- mpflash/mpflash/vendor/versions.py,sha256=osv5yFyg47_BZ85k3LRrzjyPu6T4psx56rgBN3YXMyM,3885
49
- mpflash/mpflash/worklist.py,sha256=j64PVJXm8jhLzPUQt3rnJXCbT1JEczTax46mRWID9bM,5809
50
- mpflash/poetry.lock,sha256=XBX2OYxy1q5tBn9pzXQBErgOwssrx_tVhUl8p2DZwMw,117989
51
- mpflash/pyproject.toml,sha256=sGxeBSd8LOo3l5DBlLypNW0B2kQLu-LpmdPG4ZI1lZw,1669
51
+ mpflash/mpflash/versions.py,sha256=x5VrdVfWhZJfH7tZmwu2vVx-mPrK1iunYSpSce9VUXU,4492
52
+ mpflash/poetry.lock,sha256=JBMsMo9yzGVD9SdckwbYHFDUnHfg-wHzUQYg6K93APg,118420
53
+ mpflash/pyproject.toml,sha256=MCytD4FfOtlJX5MbeO2yU1GvnqqDQzpjy1jC4e-6nFM,1701
52
54
  mpflash/stm32_udev_rules.md,sha256=LJelvFFA8w9mBcEUDA02SZ4yzNKfUFL_NWLNUb6geWY,2622
53
- stubber/__init__.py,sha256=xZBZxZVT_tkoW2-USEDpT7Ru9I5ySVZ0FERKX_Puvk0,46
54
- stubber/basicgit.py,sha256=CkS4YrAP1pLwfoihUZB5Y39uQjkQu_n4ukyrvbrlExs,9440
55
+ stubber/__init__.py,sha256=6KpMPO6c9ZEvZBPPZx5uuHwyJypuElaoMoTPmiTw7d0,46
55
56
  stubber/board/board_info.csv,sha256=3BBwHOtKfq_U0Xl8iWgNsN3akhbNMjb-TIeusDwtTXQ,8434
56
57
  stubber/board/boot.py,sha256=TEBSaKXY_TYJy9YrTRWv22m8jZRefaRNiwM8xNAlH5M,1086
57
- stubber/board/createstubs.py,sha256=ZgpiFhmDl9LrszoxqOG1SI22bpvR9NWmYFwhvCCVLhY,31936
58
- stubber/board/createstubs_db.py,sha256=Gbi5LXqAorbFJ4qjb-jIAeBhE-niPr-_9scpNEXg-V8,29558
59
- stubber/board/createstubs_db_min.py,sha256=q4CA7qs8t3dj_whlNCUrw_yebdNb_9my85snqdbiuyE,11142
60
- stubber/board/createstubs_db_mpy.mpy,sha256=Uno7GVqRV6joDZ2UsITxv2y84Hjl75h_aqM1eRuK7MI,9536
58
+ stubber/board/createstubs.py,sha256=sXSMviwCmlXL2tjyMq18L2L7Y4fOzMVFHdrqAXMxo7A,31936
59
+ stubber/board/createstubs_db.py,sha256=RS6ywP7m_C22HEQs_rhvLn5OgNnN5dKrCwdjjwzG7cQ,29558
60
+ stubber/board/createstubs_db_min.py,sha256=W4GQ1iDV7M-2QZ4EfuBQ7M-ZrqzKU_adOZ-Y7WykEJ8,11142
61
+ stubber/board/createstubs_db_mpy.mpy,sha256=oHZUyh-iTIzMN_hUFyDauX8WL8ghj-YKFpTfOQRReDM,9536
61
62
  stubber/board/createstubs_lvgl.py,sha256=LDlY2AxT5S_IZ5twi2wK9gm3SnHsDt9inrpCLOYmZIk,26476
62
63
  stubber/board/createstubs_lvgl_min.py,sha256=9L9JsZUCY0E5x4F_Uyckkd8GjiB_49guU6DN-u7XhgU,26466
63
64
  stubber/board/createstubs_lvgl_mpy.mpy,sha256=ex-nlq2V5e8anQBJvRWEEc-FzU7nlwg5NSrZ8vOadIA,9267
64
- stubber/board/createstubs_mem.py,sha256=B23Xon0wm5K8hoTZWHx6j551Jqfg-zDR70_ckiEvc74,27953
65
- stubber/board/createstubs_mem_min.py,sha256=EBMI05I-3D7f-6y6DQo5n2VfOkppKEqoJtt0huwo8v8,10713
66
- stubber/board/createstubs_mem_mpy.mpy,sha256=cNPvlft3SH_R3Epl5Tg3zDLnlG4-YAl6neUO1wfEM34,9118
67
- stubber/board/createstubs_min.py,sha256=mEo9F0ttyOeuhZ2bEeh4BKta4-yWfhbr20gATcaQx5g,13405
68
- stubber/board/createstubs_mpy.mpy,sha256=eNos3gzTHQTGN_TyB2IshtTWt6iLo98hGAfaBLIBgoI,12388
65
+ stubber/board/createstubs_mem.py,sha256=9VTkI51ReZdBGh7U0cnJsg6D3jZcO4srmGCpk_y-FpI,27953
66
+ stubber/board/createstubs_mem_min.py,sha256=T4joCuKAxUf1Op6kVtc4dZ4TSnIHrKNIZ5qUsSyAkJs,10713
67
+ stubber/board/createstubs_mem_mpy.mpy,sha256=QpuonHENnSzxDYQTOhxo9f8D8YV84KlzSLzjzUh9AOI,9118
68
+ stubber/board/createstubs_min.py,sha256=6PLxTD8XD7JGeTfJ_97DuJf-6iDbkMKCbKLHFvQE3KM,13405
69
+ stubber/board/createstubs_mpy.mpy,sha256=Nj0rwiGFEkCiaQcs-AiYcDp3NvPY2Hr-1xPRBBf9HwM,12388
69
70
  stubber/board/fw_info.py,sha256=BTupe4rZDTs3UHRqvs429XqWHCchSpwa05yACOiOt5U,4413
70
71
  stubber/board/info.py,sha256=0FCQZ5J3KFDbYe0D5iOuwhmZUUBVASPU7-L6fA7ZRGc,5446
71
72
  stubber/board/main.py,sha256=l-5RCT-MMV93SkVwXh3guzx_kxFIJciSEgH1e4UrqT8,394
@@ -83,22 +84,22 @@ stubber/codemod/board.py,sha256=WVeUbVOV8MlDAyr5JLhOLdlmyFdlOpdRunjdzM_ULsM,1156
83
84
  stubber/codemod/enrich.py,sha256=9hb2__De3eNkF8WKg0CLwYs0lngIDJ0M3nmx2yyuGCU,5293
84
85
  stubber/codemod/merge_docstub.py,sha256=-F2P9UAD98Xt8ArsNqQJ-AM6bz9H9V9E3S2d17Jk5xg,12397
85
86
  stubber/codemod/modify_list.py,sha256=_YTj3E44dwb7QaRqKaIq0IWg-BzH69AZRqTr3QMkFnY,2064
86
- stubber/codemod/utils.py,sha256=mE4Ks7-lqnxXbjQcftO_OkJGJDZyCOR4soNJSWRtMek,2402
87
+ stubber/codemod/utils.py,sha256=7I69E23wnlwABTbfszq6lZN7PNA7H5y4_KiSEu0fJ84,2403
87
88
  stubber/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
89
  stubber/commands/build_cmd.py,sha256=lZfbxPyduDkLDTCGWI_nBc_3lKwZjfWPvq4nVy2v944,2381
89
- stubber/commands/cli.py,sha256=LXeSG8-EeEb0PvlKkaRS5bscgtUsDTBLfQnqS0O6M24,1836
90
- stubber/commands/clone_cmd.py,sha256=D8rKyiuIvGDrxCgkjmiN60RzedMTLToHoRZnKc31Yh4,2663
90
+ stubber/commands/cli.py,sha256=PkwD9c3dkvhbmX5u1eGjSxE8y5Uph0Ke1_x9HTyjA-4,1836
91
+ stubber/commands/clone_cmd.py,sha256=_bSv9R6zuYp7N8dpUUMupUMk4dpFEAhRzV8HoaApGHg,2689
91
92
  stubber/commands/config_cmd.py,sha256=CMFe0IngKPJYrb3kcZ6BObBOh4dW_0Wf7etAuJthB18,964
92
93
  stubber/commands/enrich_folder_cmd.py,sha256=ysdd_CLdPCiEja4xuFOAX_a89telX4Da7cvkrpXP4lY,1798
93
94
  stubber/commands/get_core_cmd.py,sha256=VwkZl9g81LvwWu4grrIb2Qo8M5-yXrDEX5mUWJ2uKFo,2240
94
- stubber/commands/get_docstubs_cmd.py,sha256=93rWWKBKmt7D9UD0-c4mtVAH5hw5Z3PnWDpiKVfrWe8,2935
95
- stubber/commands/get_frozen_cmd.py,sha256=I9Hde0n-k5e9LHrjaUp0d5WeaamntLjtEOJQ7GCLHgc,3857
96
- stubber/commands/get_mcu_cmd.py,sha256=BzsOo1C046sRjYtS_9MM-epXF9UaElf1j23LM4aqpnI,2016
97
- stubber/commands/merge_cmd.py,sha256=VxpYGaF7JduBr43POFviT15ZecbOW1o4vqTaKMCN0jU,1622
98
- stubber/commands/publish_cmd.py,sha256=EiOYXVXyMru2lL6EOy7NSwHAS7TZXfehjvfY5r8gH3Y,2805
95
+ stubber/commands/get_docstubs_cmd.py,sha256=gGn0cUVledj4GjCqOIM8p2piiarddWknTlU5UqumC44,2935
96
+ stubber/commands/get_frozen_cmd.py,sha256=dzIivxAmef2OlVrL914ZCQUs7m9L_rkzTeh1aMsrGmk,3857
97
+ stubber/commands/get_mcu_cmd.py,sha256=7xhu8vfaa_nCyE-T-8OIedgpDTyae3KquxvLsL3Dx3E,2018
98
+ stubber/commands/merge_cmd.py,sha256=kK8SGfB3SDiNkwyhzFQyyRvmw1q2Q7kswv-ml30ktCw,1605
99
+ stubber/commands/publish_cmd.py,sha256=qfSyPXMSPE1qHe0mG9JW_90IK16E_jCF9a47TR1ywN0,2788
99
100
  stubber/commands/stub_cmd.py,sha256=PzvCppuhY2vRJJEzKbdc87WnrVEd3jPJ7AdtQeUSpn8,1171
100
- stubber/commands/switch_cmd.py,sha256=Aa4Q8LEc-mbHfO6h9orkIuR8wr9yOY-_bwL4HMPiWJ8,1825
101
- stubber/commands/variants_cmd.py,sha256=IYDmR3JyPPQ8uSZURLWbCluCV85_S38F_JKZTzRE-Lg,1251
101
+ stubber/commands/switch_cmd.py,sha256=qfJxshcKZggHsmGX-FBpLj06PAnIfHFU6hmCcFv-n34,1819
102
+ stubber/commands/variants_cmd.py,sha256=nJKePmxNzyz82b8E-qcJGvzHGTdFxowxKNOz7KDe1k4,1234
102
103
  stubber/cst_transformer.py,sha256=Er9kww4hgdeQ9dARMx8lB5PLIvPaKjtKJMe8BofKOzY,6301
103
104
  stubber/data/board_info.csv,sha256=3BBwHOtKfq_U0Xl8iWgNsN3akhbNMjb-TIeusDwtTXQ,8434
104
105
  stubber/data/board_info.json,sha256=LbyNo3qeij8bY_PRTxWoS5nFuDv6VyaRTKGiXC_-zRQ,57210
@@ -110,50 +111,49 @@ stubber/freeze/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
110
111
  stubber/freeze/common.py,sha256=gY0JSlXmwZqnoosb91M7W3wy3Ej6w48dTdJP8gKOg-U,2571
111
112
  stubber/freeze/freeze_folder.py,sha256=-n1w9jxzLjL1Sg-f9VHqHaxsBKDiPGHqBNgeY68pqq8,2422
112
113
  stubber/freeze/freeze_manifest_2.py,sha256=uogLPLb4bAah5ULkKzhWWadvu0CswGI3TygRqOb5XYc,3948
113
- stubber/freeze/get_frozen.py,sha256=9NItdnzfNjx0yC5q1EDgw1TQ39d58kBnIRTGRPIfjbs,5163
114
+ stubber/freeze/get_frozen.py,sha256=7s0thtTccXmJw6QgfeZaQX-X-STqeBWx_97Nayrffuo,5157
114
115
  stubber/get_cpython.py,sha256=PEiDn2STECuKeRBSyWx7WuexUpSsyZ-76jQrBvWZY4U,3683
115
116
  stubber/get_lobo.py,sha256=I6bVpcGX7TaD4CI9UID8R9brOG-bBdeL07j1WsTXQH4,1717
116
- stubber/minify.py,sha256=QEYCqN-ApJSpZvgx0fiLi4A-jZMnMI19B-JmNqI79Us,14618
117
+ stubber/minify.py,sha256=3PRfq6J8etJLmh0b6WQJQazotUiF0AX0zxrS1ZPRJ44,14616
117
118
  stubber/publish/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
118
119
  stubber/publish/bump.py,sha256=M9ePaH-K1lbh-OVyPNAv6uxumDtHe3cOD2rXeAMWDqY,3176
119
- stubber/publish/candidates.py,sha256=MGU1FKabawjcruMxyvgJnZHG-ZO2YU0Vl_Oz10GFUX8,10410
120
+ stubber/publish/candidates.py,sha256=JFR9V77DTwBMo_8Z-cZXHwiAA-751o54kBdVhWwAYpk,10328
120
121
  stubber/publish/database.py,sha256=fH_-Zjd_JHTEaW2Yf8kEB6DQduKrmZl9R-67mNYE3HI,605
121
- stubber/publish/defaults.py,sha256=W37MT9NW3tucLk0oDNKeGBQEtzHORu_iut_s4x1QeQA,1591
122
+ stubber/publish/defaults.py,sha256=x9E03Im7d7aCAotRSg2vjTl0bbxG-X8Sa2pxc9n61EQ,1492
122
123
  stubber/publish/enums.py,sha256=BRzoSjLxYPLcEHySaFprY1ndLLdUetqRjYJmi5CW7xU,756
123
124
  stubber/publish/helpers.py,sha256=XRN9KZgPtIEgVW6NSmZunvTiT0UqP_rr63lM69hcqbs,687
124
125
  stubber/publish/merge_docstubs.py,sha256=nQJVloB_iHnsEiILCHIJrS2dgR1bP06LtiXYyaJi4Sc,5189
125
- stubber/publish/missing_class_methods.py,sha256=TTXOid0gAhUHokLUL2SJ1Fy-YVlHWwqTPqBjVpZioEA,1774
126
- stubber/publish/package.py,sha256=GGNUgSNsJ9yX2km-MEVx8xf8jQ3qCQanK8dVCSOjVqQ,5128
127
- stubber/publish/pathnames.py,sha256=wfImW4HLftZ3gSV3zjOzSbxvhTdMFWOl9DDY8Uilvmc,1760
128
- stubber/publish/publish.py,sha256=8nC7yl4R1p8A0_7yYij8Cot-Ew7O0r84vSFiSYpJvrA,3833
126
+ stubber/publish/missing_class_methods.py,sha256=khb5JcOF6ImLunRZtFa8wMa9whnZkBsAiM1mdxTV9o8,1768
127
+ stubber/publish/package.py,sha256=Oo7QM1aDmM2-RPPlKAwytePrno1s4O6J9_P0LRzQRkE,5122
128
+ stubber/publish/pathnames.py,sha256=VwBDZZy8vsJkmcHvkRA_eaL2DSdPFRJAjvQ0KNM_288,1754
129
+ stubber/publish/publish.py,sha256=DPpzb8Jo5wyvOvJawAEqnleE20bVMZTfYzKXS3DuRqY,3827
129
130
  stubber/publish/pypi.py,sha256=fuxpVFOvvCXXjdTgEB2vWqMjhwUDDQMiHJ6N98C_JdM,1202
130
- stubber/publish/stubpackage.py,sha256=3uDhsx5LVsgrKQC7BwiorJw14QWdN6KvIBO500PhNnw,43702
131
+ stubber/publish/stubpackage.py,sha256=ntM1FZn2n0zxFWNKzKABQGNPg47T_ZJngmgDrWRv9h0,43666
131
132
  stubber/rst/__init__.py,sha256=8KUzMFNdDU9X6U1VMU1q5bGu_KGxB1XNcJhzNg7tF98,284
132
133
  stubber/rst/classsort.py,sha256=jofWVYPQQUzUhN-t2qFJT6381DH46Pjy0fTp5ek5JJU,2578
133
134
  stubber/rst/lookup.py,sha256=QIX0_xbXydfXgD-7ctni3QJo2hFN7BzsGz-5Bq1owKQ,19656
134
135
  stubber/rst/output_dict.py,sha256=tH_32ZTNj7BndvY2YcZCa1uB-lLeyJUeltoEkTT_Np8,14354
135
- stubber/rst/reader.py,sha256=JUcfMs-lu_Fg95bCAnLS70RSjOTIAk15nVMzjEPH8aU,32878
136
+ stubber/rst/reader.py,sha256=LDeH1dTWsg6hPwtXTyPX1sbRkvKqG1dGJKM2TDkBEh4,32758
136
137
  stubber/rst/report_return.py,sha256=r6WeysP2VygcBM-nk1Jo_iItcxsl6sWgWg6myHTjBFY,2745
137
138
  stubber/rst/rst_utils.py,sha256=8wfodql00CnO57x8VeNh1yoz7yx_ONa330kWuR1JFoE,17277
138
139
  stubber/stubber.py,sha256=sScRIAq7vvUZUS9Mzh4Ne6ny0qpsReGNqo0u8vtZXEc,1596
139
140
  stubber/stubs_from_docs.py,sha256=jcNdbNFQ6qZiVOVzdD8nfBNTubD-jviL_KJDPqOfTxo,2743
140
141
  stubber/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
141
- stubber/tools/manifestfile.py,sha256=hfv_bTDytZDSndKy2GuPScH9xz_YzihDY0QmrOY9RLQ,25094
142
+ stubber/tools/manifestfile.py,sha256=1P2_MUPZ6PIoHR71pLFKDycknY6N9BG8eUScV-JsUXc,25082
142
143
  stubber/tools/readme.md,sha256=NJ_g0oeeExhiRs2lMQVekccnR_c2lGLt-snu1RnUIx0,278
143
- stubber/update_fallback.py,sha256=Wi0dj5dly1UFmjpzh7dksb-RuHsSRC0i-E9H-dZ5AQo,4804
144
+ stubber/update_fallback.py,sha256=r7pVfUxVkJWVBFDfN_u5XaFJ5jg7FpFSHCFGor1UXU8,4798
144
145
  stubber/update_module_list.py,sha256=smeu-xSeFgtr1piJNR1JqLzHd3HZ1K5_iaKNRea6dzk,3886
145
- stubber/utils/__init__.py,sha256=i2OXAFcw6X1xSEwh2X355lGrM0xgmZZow9z9zRwtV5A,220
146
- stubber/utils/config.py,sha256=Xjnno__D3DEUAGmjFyECuv0cibJpCnbpFvA_fRJX3sM,4732
146
+ stubber/utils/__init__.py,sha256=FzTO7K7X4pBCRxbZjl15JyRNusidLX7uk_DgYMcIFzM,228
147
+ stubber/utils/config.py,sha256=AEKRevg9BHSbXz_5RGZR8bpuwcD3KlPuBIqmGltXu6E,4704
147
148
  stubber/utils/makeversionhdr.py,sha256=65VXDavYQU5GnR8OfbFAXAq6RCAtLdbEM-a7a3UiLxc,1899
148
- stubber/utils/manifest.py,sha256=frHSaZs_ZYLdjUl9tDSnRm6OOHjR1W7IrKMABYKaUIY,3181
149
+ stubber/utils/manifest.py,sha256=ROGiUEZsvMZ-8c8uUYMU_Uh8_HddY3u96vkUH2o8BH0,3149
149
150
  stubber/utils/post.py,sha256=qoN-XiNBNMExUdHeXbkjlsvllkG2jKB-ptuApe4kjpc,2758
150
- stubber/utils/repos.py,sha256=cQhpk_u1ZzlGdaoL3Xq7A8M7V1eyxyX1Ledp8M11gqE,5784
151
+ stubber/utils/repos.py,sha256=qquw-y5V14xqTl7Ivuh8NB5PBy1ZpaScprQFU7zAc7w,5674
151
152
  stubber/utils/stubmaker.py,sha256=1eMNpZZ-BWBtxLwBO-kz4CywjUe0JexN6QSyAVNICxM,5099
152
153
  stubber/utils/typed_config_toml.py,sha256=6nlFgHwdCcK_0MJICsstCFgm9M6TblvF-l0_2cpw_cY,2552
153
- stubber/utils/versions.py,sha256=56UhB49F2647jY9eWtkjjRuYYfJLEjC9daQFhgckgZM,4161
154
154
  stubber/variants.py,sha256=iS3sv8cT7czdI9x4KqzTCPT6hX1CKQ-bIlWnDG6gyoU,3688
155
- micropython_stubber-1.23.0.dist-info/LICENSE,sha256=2zsOXlYgl9W7_XGXcncAXIYfvSVlyNcVBycC6hhlKhA,1542
156
- micropython_stubber-1.23.0.dist-info/METADATA,sha256=Km0C0eRnH4G_oYL9jOJekeNyKSDPbVfQr4rLmJm28OA,19158
157
- micropython_stubber-1.23.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
158
- micropython_stubber-1.23.0.dist-info/entry_points.txt,sha256=NQi_M36fgq5k6giSuASas3LrpF6CVdkzfvJC0ja73_g,55
159
- micropython_stubber-1.23.0.dist-info/RECORD,,
155
+ micropython_stubber-1.23.1.dist-info/LICENSE,sha256=2zsOXlYgl9W7_XGXcncAXIYfvSVlyNcVBycC6hhlKhA,1542
156
+ micropython_stubber-1.23.1.dist-info/METADATA,sha256=5QlsVnjIFbHYFeJ7mWWejAFeON8jPpjoeNbodwomzKo,19197
157
+ micropython_stubber-1.23.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
158
+ micropython_stubber-1.23.1.dist-info/entry_points.txt,sha256=NQi_M36fgq5k6giSuASas3LrpF6CVdkzfvJC0ja73_g,55
159
+ micropython_stubber-1.23.1.dist-info/RECORD,,
mpflash/README.md CHANGED
@@ -11,8 +11,8 @@ This tool was initially created to be used in a CI/CD pipeline to automate the p
11
11
  `mpflash` has been tested on:
12
12
  - OS: Windows x64, Linux X64, but not (yet) macOS.
13
13
  - Micropython (hardware) ports:
14
- - `rp2`, using `.uf2`, using filecopy (macos not tested yet)
15
- - `samd`, using ` .uf2`, using filecopy (macos not tested yet)
14
+ - `rp2`, using `.uf2`, using filecopy
15
+ - `samd`, using ` .uf2`, using filecopy
16
16
  - `esp32`, using `.bin`, using esptool,
17
17
  - `esp8266`, using `.bin`, using esptool
18
18
  - `stm32`, using ` .dfu`, using pydfu
@@ -25,7 +25,7 @@ Not yet implemented: `nrf`, `cc3200`, `mimxrt`
25
25
  3. Flash one or all connected MicroPython boards with a specific firmware or version.
26
26
 
27
27
  ## Installation
28
- To install mpflash, you can use pip: `pip install mpflash`
28
+ To install mpflash, you can use: `pipx install mpflash` or `pip install mpflash`
29
29
 
30
30
  ## Basic usage
31
31
  You can use mpflash to perform various operations on your MicroPython boards. Here is an example of basic usage:
@@ -69,7 +69,7 @@ To download the MicroPython firmware for some boards, use the following command:
69
69
 
70
70
  These will try to download the prebuilt MicroPython firmware for the boards from https://micropython.org/download/ and save it in your downloads folder in the `firmware` directory.
71
71
  The stable version (default) is determined based on the most recent published release,
72
- other versions are `--version preview` and `--version x.y.z` to download the latest preview or version x.y.z respectively.
72
+ other options are `--version stable`, `--version preview` and `--version x.y.z` to download the latest stable, preview or version x.y.z respectively.
73
73
 
74
74
  By default the firmware will be downloaded to your OS's preferred `Downloads/firmware` folder, but you can speciy a different directory using the `--dir` option.
75
75
 
@@ -92,8 +92,18 @@ After you have downloaded a firmware you can flash the firmware to a board usin
92
92
  This will (try to) autodetect the connected boards, and determine the correct firmware to flash to each board.
93
93
 
94
94
  - `mpflash flash` will flash the latest stable firmware to all connected boards.
95
+ If you have a board withouth a running micropython version, you will need to specify the board and the serial port to flash.
95
96
  - `mpflash flash --serial ? --board ?` will prompt to select a specific serial port and board to flash. (the firmware must be dowloaded earlier)
96
97
 
98
+ In order to flash the firmware some boards need to be put in bootloader mode, this is done automatically by mpflash where possible and supported by the boards hardware and current bootloader.
99
+ The supported `--bootloader` options are:
100
+
101
+ - `touch1200` bootloader is activated by connecting to the board at 1200 baud
102
+ - `mpy` using micropython to enter the bootloader
103
+ - `manual` manual intervention is needed to enter the bootloader
104
+ - `none` mpflash assumes the board is ready to flash
105
+
106
+ For ESP32 and ESP8266 boards the `esptool` is used to flash the firmware, and this includes activating the bootloader.
97
107
 
98
108
  ### Flashing all connected boards with the latest stable firmware
99
109
  ```bash
@@ -11,7 +11,7 @@ from mpremote.mip import _rewrite_url as rewrite_url # type: ignore
11
11
 
12
12
  from mpflash.common import FWInfo
13
13
  from mpflash.config import config
14
- from mpflash.vendor.versions import get_preview_mp_version, get_stable_mp_version
14
+ from mpflash.versions import get_preview_mp_version, get_stable_mp_version
15
15
 
16
16
 
17
17
  def add_firmware(
@@ -14,7 +14,7 @@ from .config import config
14
14
  from .mpboard_id import (get_known_boards_for_port, get_known_ports,
15
15
  known_stored_boards)
16
16
  from .mpremoteboard import MPRemoteBoard
17
- from .vendor.versions import micropython_versions
17
+ from .versions import micropython_versions
18
18
 
19
19
 
20
20
  def ask_missing_params(
@@ -14,16 +14,11 @@ from github import Auth, Github
14
14
  from loguru import logger as log
15
15
  from packaging.version import parse
16
16
 
17
- # from stubber.utils.versions import get_stable_mp_version
18
- from mpflash.vendor.versions import get_stable_mp_version
19
-
20
- # from stubber.utils.versions import SET_PREVIEW
17
+ # from mpflash.versions import SET_PREVIEW
21
18
 
22
19
  # Token with no permissions to avoid throttling
23
20
  # https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#getting-a-higher-rate-limit
24
- PAT_NO_ACCESS = (
25
- "github_pat" + "_11AAHPVFQ0qAkDnSUaMKSp" + "_ZkDl5NRRwBsUN6EYg9ahp1Dvj4FDDONnXVgimxC2EtpY7Q7BUKBoQ0Jq72X"
26
- )
21
+ PAT_NO_ACCESS = "github_pat" + "_11AAHPVFQ0qAkDnSUaMKSp" + "_ZkDl5NRRwBsUN6EYg9ahp1Dvj4FDDONnXVgimxC2EtpY7Q7BUKBoQ0Jq72X"
27
22
  PAT = os.environ.get("GITHUB_TOKEN") or PAT_NO_ACCESS
28
23
  GH_CLIENT = Github(auth=Auth.Token(PAT))
29
24
 
@@ -40,9 +35,7 @@ def _run_local_git(
40
35
  if repo:
41
36
  if isinstance(repo, str):
42
37
  repo = Path(repo)
43
- result = subprocess.run(
44
- cmd, capture_output=capture_output, check=True, cwd=repo.absolute().as_posix(), encoding="utf-8"
45
- )
38
+ result = subprocess.run(cmd, capture_output=capture_output, check=True, cwd=repo.absolute().as_posix(), encoding="utf-8")
46
39
  else:
47
40
  result = subprocess.run(cmd, capture_output=capture_output, check=True, encoding="utf-8")
48
41
  except (NotADirectoryError, FileNotFoundError) as e: # pragma: no cover
@@ -74,9 +67,6 @@ def clone(remote_repo: str, path: Path, shallow: bool = False, tag: Optional[str
74
67
  cmd = ["git", "clone"]
75
68
  if shallow:
76
69
  cmd += ["--depth", "1"]
77
- if tag in {"stable"}:
78
- tag = get_stable_mp_version()
79
-
80
70
  if tag in {"preview", "latest", "master"}:
81
71
  tag = None
82
72
  cmd += [remote_repo, "--branch", tag, str(path)] if tag else [remote_repo, str(path)]
@@ -1,37 +1,2 @@
1
- import time
2
-
3
- from mpflash.common import BootloaderMethod
4
- from mpflash.errors import MPFlashError
5
- from mpflash.logger import log
6
- from mpflash.mpremoteboard import MPRemoteBoard
7
-
8
- from .manual import enter_bootloader_manual
9
- from .micropython import enter_bootloader_mpy
10
- from .touch1200 import enter_bootloader_cdc_1200bps
11
-
12
-
13
- def enter_bootloader(
14
- mcu: MPRemoteBoard,
15
- method: BootloaderMethod = BootloaderMethod.MPY,
16
- timeout: int = 10,
17
- wait_after: int = 2,
18
- ):
19
- """Enter the bootloader mode for the board"""
20
- if method == BootloaderMethod.NONE:
21
- # NO bootloader requested, so must be OK to flash
22
- return True
23
-
24
- log.info(f"Entering bootloader on {mcu.board} on {mcu.serialport} using method: {method.value}")
25
- if method == BootloaderMethod.MPY:
26
- result = enter_bootloader_mpy(mcu, timeout=timeout)
27
- elif method == BootloaderMethod.MANUAL:
28
- result = enter_bootloader_manual(mcu, timeout=timeout)
29
- elif method == BootloaderMethod.TOUCH_1200:
30
- result = enter_bootloader_cdc_1200bps(mcu, timeout=timeout)
31
- else:
32
- raise MPFlashError(f"Unknown bootloader method {method}")
33
- if result:
34
- time.sleep(wait_after)
35
- else:
36
- log.error(f"Failed to enter bootloader on {mcu.serialport}")
37
- return result
1
+ from .activate import enter_bootloader # type: ignore
2
+ from .detect import in_bootloader # type: ignore
@@ -0,0 +1,60 @@
1
+ import time
2
+
3
+ from mpflash.bootloader.detect import in_bootloader
4
+ from mpflash.common import BootloaderMethod
5
+ from mpflash.errors import MPFlashError
6
+ from mpflash.logger import log
7
+ from mpflash.mpremoteboard import MPRemoteBoard
8
+
9
+ from .manual import enter_bootloader_manual
10
+ from .micropython import enter_bootloader_mpy
11
+ from .touch1200 import enter_bootloader_touch_1200bps
12
+
13
+ BL_OPTIONS = {
14
+ "stm32": [BootloaderMethod.TOUCH_1200, BootloaderMethod.MPY, BootloaderMethod.MANUAL],
15
+ "rp2": [BootloaderMethod.TOUCH_1200, BootloaderMethod.MPY, BootloaderMethod.MANUAL],
16
+ "samd": [BootloaderMethod.TOUCH_1200, BootloaderMethod.MPY, BootloaderMethod.MANUAL],
17
+ "esp32": [BootloaderMethod.NONE],
18
+ "esp8266": [BootloaderMethod.NONE],
19
+ }
20
+
21
+
22
+ def enter_bootloader(
23
+ mcu: MPRemoteBoard,
24
+ method: BootloaderMethod = BootloaderMethod.MPY,
25
+ timeout: int = 10,
26
+ wait_after: int = 2,
27
+ ):
28
+ """Enter the bootloader mode for the board"""
29
+ if method == BootloaderMethod.NONE:
30
+ # NO bootloader requested, so must be OK to flash
31
+ return True
32
+ elif method == BootloaderMethod.AUTO:
33
+ # build a list of options to try for this board
34
+ bl_list = BL_OPTIONS.get(mcu.port, [BootloaderMethod.MPY, BootloaderMethod.MANUAL])
35
+ else:
36
+ bl_list = [method, BootloaderMethod.MANUAL]
37
+ log.info(f"Entering bootloader on {mcu.serialport} using methods {[bl.value for bl in bl_list]}")
38
+ for method in bl_list:
39
+ try:
40
+ if method == BootloaderMethod.MPY:
41
+ result = enter_bootloader_mpy(mcu, timeout=timeout)
42
+ elif method == BootloaderMethod.MANUAL:
43
+ result = enter_bootloader_manual(mcu, timeout=timeout)
44
+ elif method == BootloaderMethod.TOUCH_1200:
45
+ result = enter_bootloader_touch_1200bps(mcu, timeout=timeout)
46
+ except MPFlashError as e:
47
+ log.warning(f"Failed to enter bootloader on {mcu.serialport} using {method.value}")
48
+ log.exception(e)
49
+ result = False
50
+ if not result:
51
+ # try a next method
52
+ continue
53
+
54
+ # todo - check every second or so for up to max wait time
55
+ time.sleep(wait_after)
56
+ # check if bootloader was entered
57
+ if in_bootloader(mcu):
58
+ return True
59
+
60
+ return result
@@ -0,0 +1,82 @@
1
+ """ Detect if a board is in bootloader mode
2
+ """
3
+
4
+ import os
5
+
6
+ from mpflash.common import PORT_FWTYPES
7
+ from mpflash.flash.uf2 import waitfor_uf2
8
+ from mpflash.logger import log
9
+ from mpflash.mpremoteboard import MPRemoteBoard
10
+
11
+
12
+ def in_bootloader(mcu: MPRemoteBoard) -> bool:
13
+ """Check if the board is in bootloader mode"""
14
+ if ".uf2" in PORT_FWTYPES[mcu.port]:
15
+ return in_uf2_bootloader(mcu.port.upper())
16
+ elif mcu.port in ["stm32"]:
17
+ return in_stm32_bootloader()
18
+ elif mcu.port in ["esp32", "esp8266"]:
19
+ log.debug("esp32/esp8266 does not have a bootloader mode, Assume OK to flash")
20
+ return True
21
+
22
+ log.error(f"Bootloader mode not supported on {mcu.board} on {mcu.serialport}")
23
+ return False
24
+
25
+
26
+ def in_uf2_bootloader(board_id: str) -> bool:
27
+ """
28
+ Check if the board is in UF2 bootloader mode.
29
+
30
+ :param board_id: The board ID to check for (SAMD or RP2)
31
+ """
32
+ return bool(waitfor_uf2(board_id=board_id))
33
+
34
+
35
+ def in_stm32_bootloader() -> bool:
36
+ """Check if the board is in STM32 bootloader mode"""
37
+ if os.name == "nt":
38
+ driver_installed, status = check_for_stm32_bootloader_device()
39
+ if not driver_installed:
40
+ log.warning("STM32 BOOTLOADER device not found.")
41
+ return False
42
+ print()
43
+ if status != "OK":
44
+ log.warning(f"STM32 BOOTLOADER device found, Device status: {status}")
45
+ log.error("Please use Zadig to install a WinUSB (libusb) driver.\nhttps://github.com/pbatard/libwdi/wiki/Zadig")
46
+ return False
47
+ return check_dfu_devices()
48
+
49
+
50
+ def check_dfu_devices():
51
+ """Check if there are any DFU devices connected"""
52
+ # JIT import
53
+ from mpflash.flash.stm32_dfu import dfu_init
54
+ from mpflash.vendor.pydfu import get_dfu_devices
55
+
56
+ # need to init on windows to get the right usb backend
57
+ dfu_init()
58
+ devices = get_dfu_devices()
59
+ return len(devices) > 0
60
+
61
+
62
+ def check_for_stm32_bootloader_device():
63
+ import win32com.client
64
+
65
+ # Windows only
66
+ # Create a WMI interface object
67
+ wmi = win32com.client.GetObject("winmgmts:")
68
+
69
+ # Query for USB devices
70
+ for usb_device in wmi.InstancesOf("Win32_PnPEntity"):
71
+ try:
72
+ # Check if device name or description contains "STM32 BOOTLOADER"
73
+ if str(usb_device.Name).strip() in {
74
+ "STM32 BOOTLOADER",
75
+ "STM BOOTLOADER",
76
+ }:
77
+ # Just the first match is enough
78
+ return True, usb_device.Status
79
+ except Exception:
80
+ pass
81
+ # If no matching device was found
82
+ return False, "Not found."
@@ -12,13 +12,14 @@ from mpflash.mpremoteboard import MPRemoteBoard
12
12
 
13
13
 
14
14
  class MCUHighlighter(RegexHighlighter):
15
- """Apply style to anything that looks like an email."""
15
+ """Apply style to things that should stand out."""
16
16
 
17
17
  base_style = "mcu."
18
18
  highlights = [
19
19
  r"(?P<bold>Method[\s\d\:]*)",
20
20
  r"(?P<bold> \d.)", # numbered items
21
21
  r"(?P<bold> - )", # bullets
22
+ # mcu things
22
23
  r"(?P<pad>GPIO[\d]*)",
23
24
  r"(?P<pad>GPI[\d]*)",
24
25
  r"(?P<pad>IO[\d]*)",
@@ -33,21 +34,19 @@ class MCUHighlighter(RegexHighlighter):
33
34
  r"(?P<button>reset)",
34
35
  # other
35
36
  r"(?P<cable>USB)",
36
- # r"(?P<mcu>SAMD[\d]*)",
37
- # r"(?P<mcu>ESP[\d]*)",
38
- # r"(?P<mcu>rp2)",
39
- # r"(?P<mcu>rp2040)",
37
+ r"(?P<cable>USB-C)",
38
+ r"(?P<cable>Serial)",
40
39
  ]
41
40
 
42
41
 
43
42
  # https://rich.readthedocs.io/en/stable/appendix/colors.html?highlight=colors#standard-colors
43
+ # use 3 colors to keep things simple but clear
44
44
  mcu_theme = Theme(
45
45
  {
46
- "mcu.bold": "orange3",
47
- "mcu.mcu": "orange3",
48
- "mcu.button": "bold green",
49
- "mcu.pad": "dodger_blue2",
50
- "mcu.cable": "dodger_blue2",
46
+ "mcu.bold": "orange3", # readers guidance
47
+ "mcu.button": "bold green", # things to press
48
+ "mcu.pad": "dodger_blue2", # things to connect
49
+ "mcu.cable": "dodger_blue2", # things to connect
51
50
  }
52
51
  )
53
52
 
@@ -84,7 +83,7 @@ Please put your {mcu.port.upper()} device into bootloader mode by:
84
83
  """
85
84
 
86
85
  # todo: would be nice to re-use the console instance from logger
87
- console = Console(highlighter=MCUHighlighter(), theme=mcu_theme)
86
+ console = Console(highlighter=MCUHighlighter(), theme=mcu_theme) # type: ignore
88
87
  message += "\nIf you are unsure how to enter bootloader mode, please refer to the device documentation."
89
88
  console.print(
90
89
  Panel(
@@ -1,10 +1,12 @@
1
1
  """Module for handling the bootloader mode for micropython boards"""
2
2
 
3
+ from mpflash.logger import log
3
4
  from mpflash.mpremoteboard import MPRemoteBoard
4
5
 
5
6
 
6
7
  def enter_bootloader_mpy(mcu: MPRemoteBoard, timeout: int = 10):
7
8
  """Enter the bootloader mode for the board using mpremote and micropython on the board"""
9
+ log.info(f"Attempting bootloader on {mcu.serialport} using 'mpremote bootloader'")
8
10
  mcu.run_command("bootloader", timeout=timeout)
9
11
  # todo: check if mpremote command was successful
10
12
  return True