Page 1 of 2

esp32 -S2 usb

Posted: Mon May 11, 2020 7:00 pm
by chegewara
This is my first day with S2 saola, so please dont take this as complaining or even bug report, not yet.
My board is with installed wroom module and i wanted to try different thigs, so after mdns and ws2812 led strip i decided to test USB component. I started with dfu and flashes slowly but without bigger issues.
Next is USB component with enabled MSC. After adding necessary function with simplest code borrowed from example code flashed, but i dont see it as new mass storage. Then i had thought its maybe because it is simulating FAT12 device, so i should try with windows.

Here i encountered first bigger problem. At first i didnt realized it is related, but here may be something i dont understand. My wires are connected according to this diagram:
https://docs.espressif.com/projects/esp ... hrough-usb
which is PIN19 to white and PIN20 to green and it works on linux. The problem is that esp32 wired like this is causing my BIOS does not want to start, and when i unplug esp32 it starts. Then i let windows 10 to finish booting procedure and connect esp32 back to USB. Again, system cant find esp32 whatsoever if i revert PIN 19 and 20 windows can find unknown device.

When i tested wires in USB cable i can see that wires are like on this picture:
https://i.stack.imgur.com/I0GVI.jpg

- RED (+)
- WHITE (D-)
- GREEN (D+)
- BLACK (-)

which is not consistent with espressif docs:
20 D- (green)
19 D+ (white)
At the end of testing i rebooted to linux and here is surprise, wit reverted pins 19 and 20 linux cant find esp32 USB.

Re: esp32 -S2 usb

Posted: Tue May 12, 2020 3:52 am
by ESP_Angus
Hi chegewara,

Not sure what the problem is, but I have a couple of questions/comments:
which is PIN19 to white and PIN20 to green and it works on linux. The problem is that esp32 wired like this is causing my BIOS does not want to start, and when i unplug esp32 it starts. Then i let windows 10 to finish booting procedure and connect esp32 back to USB. Again, system cant find esp32 whatsoever if i revert PIN 19 and 20 windows can find unknown device.
Are the computers with Linux and Windows the same physical computer, or different physical computers?

Is anything else connected to the Saola board, in particular is the USB connector on the dev board connected as well? Is it possible there is some electrical issue caused by USB 5V or GND is connected to multiple things at once?
- WHITE (D-)
- GREEN (D+)

which is not consistent with espressif docs:
Thanks for pointing this out. I think this is a mistake in the ESP-IDF Programming Guide, the USB Standard gives the same colours as the ones you found - D+ is green, D- is white. (Note that you can't always rely on the cable maker to use the correct wiring colours, though - I've seen a lot of different internal combinations. It may even be worth checking that 5V and GND are wired to red/black as you expect.)

Will check with the doc author and fix if necessary.

If the ESP32-S2 works without any errors in Linux then whatever D+/D- wiring you used there is probably correct, though... (although there is some speculation that some USB hosts might accept reversed wires for Low Speed devices, in some cases.)

Re: esp32 -S2 usb

Posted: Tue May 12, 2020 7:15 am
by chegewara
1. Yes, its the same physical machine, 2 systems
2. I tested wires even before i started connecting to saola, thats why i know D-/D+ are consistent with picture i posted,
3. Yes, had connected both, CP2102 and S2 to USB
4. For some time, before i found that issue i had connected 5V from USB to 3.3V pin on saola by mistake, but board seems to work normally, except when 5V connected to 3.3V pin wifi is not working


In general my concern is that we need to swap pins and to use different configuration on linux and on windows. That is disturbing for eventual USB host products.


EDIT i did some more tests and esp32 S2 is recognized on linux and windows with the same pin connections pin19 - D- and pin20 - D+.
Problem was with tinyusb MSC app installed on saola, this requires more investigation


PS any chance to buy esp32s2 kaluga board yet?

Re: esp32 -S2 usb

Posted: Wed May 13, 2020 11:12 am
by ESP_Roland
Thank you chegewara for the feedback.

The documentation fix is under way. The wire coloring was correct but D+ and D- were swapped. With this setup it is working for me on Linux and Windows as well.

I see in a local hardware store that they are expecting Kaluga boards the next month. You can contact the sales division: https://www.espressif.com/en/contact-us/sales-questions.

Re: esp32 -S2 usb

Posted: Wed May 13, 2020 11:32 am
by chegewara
Yes, i agree it is working both on linux and windows and coloring was correct in docs. Thanks

The clue for my problem was link posted by Angus (thanks), that is mentioning that some USB device requires swapping polarity pins.
https://electronics.stackexchange.com/q ... 3297#73297

I will do more tests with logic analyzer and post results when i confirm it is true. The fact is when i flash tinyusb descriptors example i am having earlier mentioned issues with booting PC.

Thanks for help.

PS i was asking about Kaluga strictly for personal use, to learn esp32 S2 for future jobs and maybe to help in esp-idf/arduino bug tracking

Re: esp32 -S2 usb

Posted: Fri May 15, 2020 8:36 am
by Olof Astrand
I was able to order a Kaluga board from Digikey. Still 8 in stock. https://www.digikey.com/products/en?keywords=kaluga . I could not find so much documentation online, so I thought I post my findings here. https://github.com/Ebiroll/esp32s2_kaluga. I expect to have some information within 12 hours, unless UPS loose the package.

Re: esp32 -S2 usb

Posted: Fri May 15, 2020 11:56 am
by ESP_igrr
Hi Olof,

The getting started guide for Kaluga board has been merged, and should be available on Github in the next few days.

Re: esp32 -S2 usb

Posted: Sat May 16, 2020 6:13 pm
by chegewara
Olof Astrand wrote:
Fri May 15, 2020 8:36 am
I was able to order a Kaluga board from Digikey. Still 8 in stock. https://www.digikey.com/products/en?keywords=kaluga . I could not find so much documentation online, so I thought I post my findings here. https://github.com/Ebiroll/esp32s2_kaluga. I expect to have some information within 12 hours, unless UPS loose the package.
Thanks for tip, its not cheap dev board but ordered one.

Re: esp32 -S2 usb

Posted: Mon May 18, 2020 10:26 am
by Olof Astrand
Expensive but it is a nice board for doing experiments, with several daugtherboards and a camera.
I also like the built in JTAG controller and the extra breakout pins.
I translated some examples from Chinese but hope espressif will have official support soon.
https://github.com/Ebiroll/esp32s2_kalu ... amples/lcd

Re: esp32 -S2 usb

Posted: Mon May 18, 2020 10:36 am
by ESP_Roland
I think this might be what you are looking for: https://docs.espressif.com/projects/esp ... 1-kit.html