Josverl / micropython-stubber

Generate and maintain stubs for different MicroPython ports to use with VSCode and Pylance, PyRight, Thonny, PyCharm or MyPy
https://micropython-stubber.readthedocs.io
Other
175 stars 14 forks source link

mpflash: does not identify 'ESP32 module with ESP32' v1.13 #558

Closed Josverl closed 4 months ago

Josverl commented 5 months ago

I have no idea what image is on that board - might be loaded by the vendor. In Thonny it says MicroPython v1.13 on 2020-09-02; ESP32 module with ESP32

-=- After flashing :

┏━━━━━━┳━━━━━━━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━┳━━━━━━━┓
┃Serial┃Family     ┃Port ┃Board                  ┃CPU  ┃Version┃
┡━━━━━━╇━━━━━━━━━━━╇━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━╇━━━━━━━┩
│COM20 │micropython│esp32│UNKNOWN_BOARD          │ESP32│v1.13  │
│      │           │     │ESP32 module with ESP32│     │       │
└──────┴───────────┴─────┴───────────────────────┴─────┴───────┘
[
    {
        "serialport": "COM20",
        "firmware": {},
        "connected": true,
        "path": null,
        "family": "micropython",
        "description": "ESP32 module with ESP32",
        "version": "1.13",
        "port": "esp32",
        "board": "UNKNOWN_BOARD",
        "cpu": "ESP32",
        "arch": "xtensawin",
        "mpy": "v5.2",
        "build": ""
    }
]

Originally posted by @wovo in https://github.com/micropython/micropython/discussions/14395#discussioncomment-9318383

Josverl commented 5 months ago

the bug was was caused by a combination of two things :

Due to this the ESPxx and rp2 boards older than 1.20.x could not be identified

Fixed by passing the version and adding tests

> mpflash list

                        Connected boards
┏━━━━━━┳━━━━━━━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━┳━━━━━━━┓
┃Serial┃Family     ┃Port ┃Board                  ┃CPU  ┃Version┃
┡━━━━━━╇━━━━━━━━━━━╇━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━╇━━━━━━━┩
│COM20 │micropython│esp32│GENERIC                │ESP32│v1.13  │
│      │           │     │ESP32 module with ESP32│     │       │
└──────┴───────────┴─────┴───────────────────────┴─────┴───────┘

> mpflash list --json

[
    {
        "serialport": "COM20",
        "firmware": {},
        "connected": true,
        "path": null,
        "family": "micropython",
        "description": "ESP32 module with ESP32",
        "version": "1.13",
        "port": "esp32",
        "board": "GENERIC",
        "cpu": "ESP32",
        "arch": "xtensawin",
        "mpy": "v5.2",
        "build": ""
    }
]