Page 1 of 1

ESP32C3 USB示例问题

Posted: Mon Mar 21, 2022 6:58 am
by Lisdon
IDF版本:4.3、4.4中示例默认只支持S2\S3系列的芯片,对C3似乎不友好,是否还有我不知道的构建方法

Re: ESP32C3 USB示例问题

Posted: Tue Mar 22, 2022 3:10 am
by Lisdon
发现芯片系列不同会缺少 "usb/usb_host.h",能否直接在doxyfile——esp32c3补上引用 :roll:

Re: ESP32C3 USB示例问题

Posted: Tue Mar 22, 2022 3:40 am
by Lisdon
找了一轮,发现C3的USB的外设接口未实现,有开发计划吗 :(

Re: ESP32C3 USB示例问题

Posted: Wed Mar 23, 2022 9:41 am
by ESP_morris
C3的USB是辅助开发用的,只有device模式,用来虚拟出串口和JTAG口的

Re: ESP32C3 USB示例问题

Posted: Thu Mar 24, 2022 1:49 am
by Lisdon
既然有这个串口,这个串口的驱动方式也没有,我在example/peripherals/USB下没找到能支持C3的示例,现在printf可以输出内容到虚拟串口,但我需要一个接受回调进行接受数据的处理

Re: ESP32C3 USB示例问题

Posted: Thu Mar 24, 2022 5:18 am
by ESP_morris
你可以看看驱动本身, driver/usb_serial_jtag.h 是否提供了你要的接口.

Re: ESP32C3 USB示例问题

Posted: Thu Apr 20, 2023 12:14 pm
by eiicode
我也遇到了这个问题;

Re: ESP32C3 USB示例问题

Posted: Tue Apr 25, 2023 9:12 am
by ESP_Junru
c3 没有 otg 外设,所以更改不了 USB 描述符,仅支持:

Code: Select all

/**
 * @brief USB_SERIAL_JTAG read bytes from USB_SERIAL_JTAG buffer
 *
 * @param buf     pointer to the buffer.
 * @param length  data length
 * @param ticks_to_wait Timeout in RTOS ticks
 *
 * @return
 *     - The number of bytes read from USB_SERIAL FIFO
 */
int usb_serial_jtag_read_bytes(void* buf, uint32_t length, TickType_t ticks_to_wait);

/**
 * @brief Send data to the USB-UART port from a given buffer and length,
 *
 * Please ensure the `tx_buffer_size is larger than 0`, if the 'tx_buffer_size' > 0, this function will return after copying all the data to tx ring buffer,
 * USB_SERIAL_JTAG ISR will then move data from the ring buffer to TX FIFO gradually.
 *
 * @param src   data buffer address
 * @param size  data length to send
 * @param ticks_to_wait Maximum timeout in RTOS ticks
 *
 * @return
 *     - The number of bytes pushed to the TX FIFO
 */
int usb_serial_jtag_write_bytes(const void* src, size_t size, TickType_t ticks_to_wait);
如需使用 USB 开发,请使用 esp32s2/s3