Reconfigure USB/JTAG module

Stipa88
Posts: 25
Joined: Mon May 09, 2022 12:26 pm

Reconfigure USB/JTAG module

Postby Stipa88 » Fri Sep 19, 2025 8:01 am

Hi all.

Due to the lack of IO pins, I am forced to use the USB_N (IO_18) pin in the code. In the code, I configure that pin to be a GPIO output pin. USB/JTAG is no longer available, and the device is not seen as a COM port.

Question:

How can I reconfigure the GPIO pin during operation, so that USB/JTAG becomes available, and the device is seen as a COM port?
Thanks

Environment is
IDF 5.0
Windows
ESP32-C3_MINI

ahsrabrifat
Posts: 201
Joined: Sat Jan 18, 2025 2:31 pm

Re: Reconfigure USB/JTAG module

Postby ahsrabrifat » Fri Sep 19, 2025 6:00 pm

You can reconfigure GPIO18 back to USB function by calling gpio_reset_pin(18) (and 19 if touched) and re-installing the USB stack (e.g., tinyusb_driver_install). However, the host will see it as a new enumeration event — it won’t keep the same COM port session alive.

Who is online

Users browsing this forum: Applebot, ChatGPT-User, Qwantbot, Semrush [Bot], YisouSpider and 3 guests