ESP32C3 USB示例问题

Lisdon
Posts: 9
Joined: Thu Sep 19, 2019 1:38 am

ESP32C3 USB示例问题

Postby Lisdon » Mon Mar 21, 2022 6:58 am

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

Lisdon
Posts: 9
Joined: Thu Sep 19, 2019 1:38 am

Re: ESP32C3 USB示例问题

Postby Lisdon » Tue Mar 22, 2022 3:10 am

发现芯片系列不同会缺少 "usb/usb_host.h",能否直接在doxyfile——esp32c3补上引用 :roll:

Lisdon
Posts: 9
Joined: Thu Sep 19, 2019 1:38 am

Re: ESP32C3 USB示例问题

Postby Lisdon » Tue Mar 22, 2022 3:40 am

找了一轮,发现C3的USB的外设接口未实现,有开发计划吗 :(

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

Re: ESP32C3 USB示例问题

Postby ESP_morris » Wed Mar 23, 2022 9:41 am

C3的USB是辅助开发用的,只有device模式,用来虚拟出串口和JTAG口的

Lisdon
Posts: 9
Joined: Thu Sep 19, 2019 1:38 am

Re: ESP32C3 USB示例问题

Postby Lisdon » Thu Mar 24, 2022 1:49 am

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

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

Re: ESP32C3 USB示例问题

Postby ESP_morris » Thu Mar 24, 2022 5:18 am

你可以看看驱动本身, driver/usb_serial_jtag.h 是否提供了你要的接口.

eiicode
Posts: 1
Joined: Thu Apr 20, 2023 6:32 am

Re: ESP32C3 USB示例问题

Postby eiicode » Thu Apr 20, 2023 12:14 pm

我也遇到了这个问题;

ESP_Junru
Posts: 49
Joined: Tue Jul 12, 2022 6:26 am

Re: ESP32C3 USB示例问题

Postby ESP_Junru » Tue Apr 25, 2023 9:12 am

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

Who is online

Users browsing this forum: No registered users and 74 guests