Skip to content

ESP32_GENERIC_S2 changes comport during flash - #16

@Josverl

Description

@Josverl

repro steps

  • Generic ESP32S2 module with ESP32S2 - 1.25.0-preview - 405
  • Connected via USB / CDC
  • mpflash flash --version preview
11:33:34 | ℹ️ Found preview firmware esp32\ESP32_GENERIC_S2-v1.25.0-preview.408.bin for ESP32_GENERIC_S2 on COM38.
11:33:34 | ℹ️ Updating ESP32_GENERIC_S2 on COM38 to v1.25.0
11:33:34 | ℹ️ Flashing C:\Users\josverl\Downloads\firmware\esp32\ESP32_GENERIC_S2-v1.25.0-preview.408.bin on
ESP32_GENERIC_S2 on COM38
11:33:34 | ℹ️ Running esptool --chip esp32s2 --port COM38 -b 460800 write_flash --flash_mode keep --flash_size detect
--compress 0x1000 C:\Users\josverl\Downloads\firmware\esp32\ESP32_GENERIC_S2-v1.25.0-preview.408.bin
esptool.py v4.8.1
Serial port COM38
Connecting......................................
11:33:38 | ❌ Failed to flash ESP32_GENERIC_S2 on COM38 : Failed to connect to ESP32-S2: Invalid head of packet (0x08):
Possible serial noise or corruption.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
11:33:38 | ❌ Failed to flash ESP32_GENERIC_S2 on COM38
11:33:38 | ❌ No boards were flashed
  • run mpremote bootloader
    --> Board reconnects to COM33
  • after this it is possible to flash using the esptool cmdline adjusted to the new comport
  • esptool --chip esp32s2 --port COM33 -b 460800 write_flash --flash_mode keep --flash_size detect --compress 0x1000 C:\Users\josverl\Downloads\firmware\esp32\ESP32_GENERIC_S2-v1.25.0-preview.408.bin
  • after flashing the device reconnects as COM38 ( or COM37 ) assumably depending on the firmware details
    {
        "serialport": "COM38",
        "connected": true,
        "family": "micropython",
        "description": "Generic ESP32S2 module with ESP32S2",
        "version": "1.25.0-preview",
        "port": "esp32",
        "board": "ESP32_GENERIC_S2",
        "variant": "",
        "cpu": "ESP32S2",
        "arch": "xtensawin",
        "mpy": "v6.3",
        "build": "405",
        "location": "USB VID:PID=303A:4001 SER=7CDFA11AB25E0000",
        "toml": {}
    }

COM38

    =========================== USB Port4 ===========================

Connection Status        : 0x01 (Device is connected)
Port Chain               : 1-6-1-4
Properties               : 0x01
 IsUserConnectable       : yes
 PortIsDebugCapable      : no
 PortHasMultiCompanions  : no
 PortConnectorIsTypeC    : no
ConnectionIndex          : 4
CompanionIndex           : 0
 CompanionHubSymLnk      : USB#VID_0BDA&PID_0411#6&23393a33&0&1#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
 CompanionPortNumber     : 4
 -> CompanionPortChain   : 2-3-1-4

      ======================== USB Device ========================

        +++++++++++++++++ Device Information ++++++++++++++++++
Device Description       : USB Composite Device
Device Path              : \\?\USB#VID_303A&PID_4001#7cdfa11ab25e0000#{a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
Kernel Name              : \Device\USBPDO-10
Device ID                : USB\VID_303A&PID_4001\7CDFA11AB25E0000
Hardware IDs             : USB\VID_303A&PID_4001&REV_0100 USB\VID_303A&PID_4001
Driver KeyName           : {36fc9e60-c465-11cf-8056-444553540000}\0108 (GUID_DEVCLASS_USB)
Driver                   : \SystemRoot\System32\drivers\usbccgp.sys (Version: 10.0.26100.1882  Date: 2024-10-03)
Driver Inf               : C:\WINDOWS\inf\usb.inf
Legacy BusType           : PNPBus
Class                    : USB
Class GUID               : {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB)
Service                  : usbccgp
Enumerator               : USB
Location Info            : Port_#0004.Hub_#0006
Location IDs             : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(6)#USB(1)#USB(4), ACPI(_SB_)#ACPI(PC00)#ACPI(XHCI)#ACPI(RHUB)#ACPI(HS06)#USB(1)#USB(4)
Container ID             : {6f94435d-05b1-5bc3-8df5-c5197617289a}
Manufacturer Info        : (Standard USB Host Controller)
Capabilities             : 0x94 (Removable, UniqueID, SurpriseRemovalOK)
Status                   : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
Problem Code             : 0
Address                  : 4
HcDisableSelectiveSuspend: 0
EnableSelectiveSuspend   : 0
SelectiveSuspendEnabled  : 0
EnhancedPowerMgmtEnabled : 0
IdleInWorkingState       : 0
WakeFromSleepState       : 0
Power State              : D0 (supported: D0, D2, D3, wake from D0, wake from D2)
 Child Device 1          : USB Serial Device (COM38)
  Device Path            : \\?\USB#VID_303A&PID_4001&MI_00#8&36ebc89&0&0000#{86e0d1e0-8089-11d0-9ce4-08003e301f73} (GUID_DEVINTERFACE_COMPORT)
  Kernel Name            : \Device\000004f1
  Device ID              : USB\VID_303A&PID_4001&MI_00\8&36EBC89&0&0000
  Class                  : Ports
  Driver KeyName         : {4d36e978-e325-11ce-bfc1-08002be10318}\0035 (GUID_DEVCLASS_PORTS)
  Service                : usbser
  COM-Port               : COM38 (\Device\USBSER000)

COM33

    =========================== USB Port4 ===========================

Connection Status        : 0x01 (Device is connected)
Port Chain               : 1-6-1-4
Properties               : 0x01
 IsUserConnectable       : yes
 PortIsDebugCapable      : no
 PortHasMultiCompanions  : no
 PortConnectorIsTypeC    : no
ConnectionIndex          : 4
CompanionIndex           : 0
 CompanionHubSymLnk      : USB#VID_0BDA&PID_0411#6&23393a33&0&1#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
 CompanionPortNumber     : 4
 -> CompanionPortChain   : 2-3-1-4

      ======================== USB Device ========================

        +++++++++++++++++ Device Information ++++++++++++++++++
Device Description       : USB Composite Device
Device ID                : USB\VID_303A&PID_0002\0
Hardware IDs             : USB\VID_303A&PID_0002&REV_0723 USB\VID_303A&PID_0002
Driver KeyName           : {36fc9e60-c465-11cf-8056-444553540000}\0099 (GUID_DEVCLASS_USB)
Driver                   : \SystemRoot\System32\drivers\usbccgp.sys (Version: 10.0.26100.1882  Date: 2024-10-03)
Driver Inf               : C:\WINDOWS\inf\usb.inf
Legacy BusType           : PNPBus
Class                    : USB
Class GUID               : {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB)
Service                  : usbccgp
Enumerator               : USB
Location Info            : Port_#0004.Hub_#0006
Location IDs             : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(6)#USB(1)#USB(4), ACPI(_SB_)#ACPI(PC00)#ACPI(XHCI)#ACPI(RHUB)#ACPI(HS06)#USB(1)#USB(4)
Container ID             : {edc5ebf0-5eb5-5a65-beb0-b0913ba91139}
Manufacturer Info        : (Standard USB Host Controller)
Capabilities             : 0x94 (Removable, UniqueID, SurpriseRemovalOK)
Status                   : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
Problem Code             : 0
Address                  : 4
HcDisableSelectiveSuspend: 0
EnableSelectiveSuspend   : 0
SelectiveSuspendEnabled  : 0
EnhancedPowerMgmtEnabled : 0
IdleInWorkingState       : 0
WakeFromSleepState       : 0
Power State              : D0 (supported: D0, D2, D3, wake from D0, wake from D2)
 Child Device 1          : ESP32-S2
  Device ID              : USB\VID_303A&PID_0002&MI_02\8&1FE9EA56&0&0002
  Problem                : 28 (CM_PROB_FAILED_INSTALL)
 Child Device 2          : USB Serial Device (COM33)
  Device ID              : USB\VID_303A&PID_0002&MI_00\8&1FE9EA56&0&0000
  Class                  : Ports
  Driver KeyName         : {4d36e978-e325-11ce-bfc1-08002be10318}\0030 (GUID_DEVCLASS_PORTS)
  Service                : usbser
  COM-Port               : COM33 (\Device\USBSER000)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions