ESP32-S2 USB-CDC Flashing (Arduino)
ESP32-S2 USB-CDC Flashing (Arduino)
Hi All,
I have tried and used successfully the esp-idf version of USB CDC by enabling "USB Console" feature to upload the firmwares. Besides, it's possible to read and write from/to any serial terminal as well. However, there is a problem on Arduino IDE side, how could it be possible to use native USB (with the help of CDC) for uploading the sketches with auto-boot and auto-reset feature? I mean, without having any intervention or any manipulation with boot and reset buttons.
Thanks in advance for your support and interest.
I have tried and used successfully the esp-idf version of USB CDC by enabling "USB Console" feature to upload the firmwares. Besides, it's possible to read and write from/to any serial terminal as well. However, there is a problem on Arduino IDE side, how could it be possible to use native USB (with the help of CDC) for uploading the sketches with auto-boot and auto-reset feature? I mean, without having any intervention or any manipulation with boot and reset buttons.
Thanks in advance for your support and interest.
Re: ESP32-S2 USB-CDC Flashing (Arduino)
I don't think that's natively possible with the S2. If I remember correctly it will be possible with the S3 (or was it C3?)
Maybe it's possible to write something like the OTA update. Code which accepts uploading of the compiled binaryover USB serial and then flashes it. Won't be easy to make it work with the IDE however.
Maybe it's possible to write something like the OTA update. Code which accepts uploading of the compiled binaryover USB serial and then flashes it. Won't be easy to make it work with the IDE however.
Re: ESP32-S2 USB-CDC Flashing (Arduino)
No, it's absolutely possible and I had succeeded with esp-idf. You can have the link below.Miraculix wrote: ↑Thu Feb 11, 2021 8:03 pmI don't think that's natively possible with the S2. If I remember correctly it will be possible with the S3 (or was it C3?)
Maybe it's possible to write something like the OTA update. Code which accepts uploading of the compiled binaryover USB serial and then flashes it. Won't be easy to make it work with the IDE however.
https://docs.espressif.com/projects/esp ... nsole.html
The problem is the implementation of that feature on Arduino side. It's working properly with esp-idf.
On Ardunio, "tinyusb stack" is used, but it was not possible for me to use the usb cdc feature, it does not get active.
The simplest solution might be the implementation of "USB Console" feature of ROM bootloader to the Arduino Core.
Is not there anyone who got that solution or any idea how to solve it?
It is a "must have feature" though, it is not acceptable to use Arduino IDE without USB CDC (DFU) option for uploading the sketches. If you have a built-in USB peripheral, then you must have that option on your IDE.
Waiting for your valuable considerations and help...
Re: ESP32-S2 USB-CDC Flashing (Arduino)
Maybe you will provide more info about your setup. There is no issue to flash esp32 S2 over native USB as long as there is already installed CDC, because arduino IDE has to recognize device and USB port. The only issue i have, dont remember if always, is the reset after flashing.
Re: ESP32-S2 USB-CDC Flashing (Arduino)
It's not possible, I mean I cannot succeed, to install CDC feature. It's OK while using download mode with reset and boot button. However, as the CDC does not installed properly, there is no port available after uploading finished and pushed reset button. No auto boot, no auto reset due to not having properly installed CDC.chegewara wrote: ↑Thu Feb 11, 2021 9:35 pmMaybe you will provide more info about your setup. There is no issue to flash esp32 S2 over native USB as long as there is already installed CDC, because arduino IDE has to recognize device and USB port. The only issue i have, dont remember if always, is the reset after flashing.
How could it possible to install CDC feature to have a proper operation?
Re: ESP32-S2 USB-CDC Flashing (Arduino)
The easiest way is to install empty sketch with "Serial connected to: USB CDC" and then all your builds with that option will flash without using boot button.
Re: ESP32-S2 USB-CDC Flashing (Arduino)
I have tried different sketches with "Serial connected to USB CDC" option, but unfortunately no success.
I am using ESP32-S2 Saola board and the OS is Win 10, could be a problem related to OS?
Re: ESP32-S2 USB-CDC Flashing (Arduino)
I have to apology, looks like it is not working now for some reason, but it was before. Here you can find discussion and confirmation it has been added to arduino (maybe it will help):
https://github.com/espressif/arduino-es ... -633761259
https://github.com/espressif/arduino-es ... -633761259
Re: ESP32-S2 USB-CDC Flashing (Arduino)
Thanks for the discussion. You have anything in your mind to recommend as a solution?chegewara wrote: ↑Fri Feb 12, 2021 10:17 pmI have to apology, looks like it is not working now for some reason, but it was before. Here you can find discussion and confirmation it has been added to arduino (maybe it will help):
https://github.com/espressif/arduino-es ... -633761259
Re: ESP32-S2 USB-CDC Flashing (Arduino)
I investigated it a bit today and there is something changed in tinyusb library which is in idf-release/v4.2, since branch esp32s2 works good, and by works good i mean if you have flashed USBSerial example from branch esp32s2, then you can flash anything over native USB from any branch. Currentlu USBSerial example cant be installed, due some issue in tinyusb and misconfiguration.
Who is online
Users browsing this forum: No registered users and 48 guests