ESP32-C6 USB Serial/JTAG controller usage

g2256090
Posts: 2
Joined: Tue Mar 19, 2024 3:35 pm

ESP32-C6 USB Serial/JTAG controller usage

Postby g2256090 » Tue Mar 19, 2024 3:51 pm

Good morning everyone.

I would like to develop an application with the ESP32-C6 board that appears as a USB peripheral to the PC. When connected to the PC, the application should be able to receive and send data. From what I understand, the ESP32-C6 board has a USB controller. Despite this, I have not been able to find examples that utilize this controller to send/receive data via USB. On the Espressif repository, only examples compatible with S3 or C3 boards containing the so-called USB OTG are available.

Can anyone help me? For now, I have only managed to write and read via UART as in the "simple console" example. Should I start from this example? I'm not interested in having an interactive console, I just need data to be transmitted and received via USB CDC. I apologize in advance if I seem confused, perhaps I missed something. Thanks in advance.

g2256090
Posts: 2
Joined: Tue Mar 19, 2024 3:35 pm

Re: ESP32-C6 USB Serial/JTAG controller usage

Postby g2256090 » Thu Mar 21, 2024 8:28 am

I found out a way to work with ESP32-C6 USB.
I'm using usb_serial_jtag_driver_install() followed by "usb_serial_jtag_read_bytes()" and "usb_serial_jtag_write_and_flush()" to read and write. I set sdkconfig "Channel for console output" to UART0 and "Channel for secondary output" to USB/JTAG. With this settings I'm able to use USB to send/receive data I need to exchange with the PC and I can see logs (aka ESP_LOGx) on UART0.
I'm not shure this is a good way to do things and I'm opened to suggestions or ideas.

Who is online

Users browsing this forum: No registered users and 119 guests