esp-rs / espflash

Serial flasher utility for Espressif SoCs and modules based on esptool.py
Apache License 2.0
478 stars 116 forks source link

espflash on WSL 2 (with usbipd) doesn't work #641

Open dom96 opened 4 months ago

dom96 commented 4 months ago

I've successfully flashed my ESP32 via other tools in WSL 1, but espflash does not work for me (even if I try it with usbipd set up on WSL2).

Here is what I'm seeing:

$ sudo usbip list -r 172.19.96.1
Exportable USB devices
======================
 - 172.19.96.1
        1-7: Silicon Labs : CP210x UART Bridge (10c4:ea60)
           : USB\VID_10C4&PID_EA60\0001
           : (Defined at Interface level) (00/00/00)
           :  0 - Vendor Specific Class / unknown subclass / unknown protocol (ff/00/00)

$ sudo usbip attach -r 172.19.96.1 --busid=1-7
$ sudo usbip port
Imported USB devices
====================
Port 00: <Port in Use> at Full Speed(12Mbps)
       Silicon Labs : CP210x UART Bridge (10c4:ea60)
       1-1 -> usbip://172.19.96.1:3240/1-7
           -> remote bus/dev 001/007
$ espflash board-info
Error: espflash::no_serial

  × No serial ports could be detected
  help: Make sure you have connected a device to the host system. If the device is connected but not listed, try
        using the `--list-all-ports` flag.

Am I missing something or should this work?

SergioGasquez commented 4 months ago

Hi! Have you tried the --list-all-ports flag as suggested by the error message? I'm not a Windows user, but I know some colleagues are using WSL2 with no issues.

dom96 commented 4 months ago

Yep, I have. It doesn't change the output.

dom96 commented 4 months ago

Also FWIW it's working just fine in Windows PowerShell.

akauppi commented 3 months ago

I've successfully flashed my ESP32 via other tools in WSL 1, but espflash does not work for me (even if I try it with usbipd set up on WSL2).

My setup is:

Have you tried attaching the device completely from Windows side, i.e.

> usbipd attach --wsl -b 1-7

I don't ever (need to) do usbip on the WSL side. In particular, espflash board-info works for me with the above setup, and ESP32-C3-DevKit-RUST-1 (chip rev 0.4) board.

akauppi commented 3 months ago

..if that doesn't help, I would try installing the CP210x Universal Windows Driver (v.11.3.0) on Windows side from here.

I can see you are using a standard UART (not JTAG) connector. Could it be that even though WSL properly lists it as "Silicon Labs : CP210x UART Bridge", it'd still need a driver on the Windows side?

Eplankton commented 3 weeks ago

..if that doesn't help, I would try installing the CP210x Universal Windows Driver (v.11.3.0) on Windows side from here.

I can see you are using a standard UART (not JTAG) connector. Could it be that even though WSL properly lists it as "Silicon Labs : CP210x UART Bridge", it'd still need a driver on the Windows side?

Exactly same problem for me.