Reset when the USB CDC is disconnected
Posted: Mon Mar 06, 2023 12:33 am
by matsujirushi
Hi,
I am trying USB CDC of ESP32-C3.
The ESP32-C3 seems to reset when the USB CDC is disconnected from the PC's terminal software.
(Checked in "Basic Console Example".
https://github.com/espressif/esp-idf/tr ... sole/basic )
Is there a way to prevent it from resetting on disconnect?
Re: Reset when the USB CDC is disconnected
Posted: Tue Aug 22, 2023 6:25 pm
by xleaderx
I see that nobody answer...
I have the same issue.
Did you found any solution?
Re: Reset when the USB CDC is disconnected
Posted: Wed Aug 23, 2023 2:12 am
by ESP_Sprite
What is your setup (hw/sw)?
Re: Reset when the USB CDC is disconnected
Posted: Thu Aug 24, 2023 4:02 pm
by abellofiore
The built-in CDC hardware looks at CTS and DTR from the host to control the boot mode and reset of the ESP32. Windows controls these lines (annoyingly) and there's really nothing you can do about this when connecting/disconnecting.
What you CAN do is NOT use the built-in CDC controller. On the ESP32-S3, you can disable it entirely in eFuse (if you want) and switch the PHY to use the CPU when your image boots up, then implement the CDC controller using TinyUSB (there are examples). Then, you can can ignore CTS DTR as you like.
If you don't disable the CDC in eFuse, on power-up, you'll see the built-in CDC briefly, then it will go away and be replaced with your SW CDC instance.