UPDATE: Seems like I just have to enable the TinyUSB Stack option, then the Enable TinyUSB CDC feature. However, when I do this, I get the following errors:
Code: Select all
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:29:25: error: 'tinyusb_add_string_descriptor' was not declared in this scope
uint8_t str_index = tinyusb_add_string_descriptor("TinyUSB CDC");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:30:24: error: 'TUD_CDC_DESC_LEN' was not declared in this scope
uint8_t descriptor[TUD_CDC_DESC_LEN] = {
^~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:32:13: error: 'TUD_CDC_DESCRIPTOR' was not declared in this scope
TUD_CDC_DESCRIPTOR(*itf, str_index, 0x85, 64, 0x03, 0x84, 64)
^~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:35:17: error: 'descriptor' was not declared in this scope
memcpy(dst, descriptor, TUD_CDC_DESC_LEN);
^~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:35:17: note: suggested alternative: 'encrypt'
memcpy(dst, descriptor, TUD_CDC_DESC_LEN);
^~~~~~~~~~
encrypt
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp: At global scope:
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:48:42: error: 'cdc_line_coding_t' has not been declared
void tud_cdc_line_coding_cb(uint8_t itf, cdc_line_coding_t const* p_line_coding)
^~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp: In function 'void tud_cdc_line_coding_cb(uint8_t, const int*)':
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:51:52: error: request for member 'bit_rate' in '* p_line_coding', which is of non-class type 'const int'
devices[itf]->_onLineCoding(p_line_coding->bit_rate, p_line_coding->stop_bits, p_line_coding->parity, p_line_coding->data_bits);
^~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:51:77: error: request for member 'stop_bits' in '* p_line_coding', which is of non-class type 'const int'
devices[itf]->_onLineCoding(p_line_coding->bit_rate, p_line_coding->stop_bits, p_line_coding->parity, p_line_coding->data_bits);
^~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:51:103: error: request for member 'parity' in '* p_line_coding', which is of non-class type 'const int'
devices[itf]->_onLineCoding(p_line_coding->bit_rate, p_line_coding->stop_bits, p_line_coding->parity, p_line_coding->data_bits);
^~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:51:126: error: request for member 'data_bits' in '* p_line_coding', which is of non-class type 'const int'
devices[itf]->_onLineCoding(p_line_coding->bit_rate, p_line_coding->stop_bits, p_line_coding->parity, p_line_coding->data_bits);
^~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp: In constructor 'USBCDC::USBCDC(uint8_t)':
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:99:30: error: 'USB_INTERFACE_CDC' was not declared in this scope
tinyusb_enable_interface(USB_INTERFACE_CDC, TUD_CDC_DESC_LEN, load_cdc_descriptor);
^~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:99:49: error: 'TUD_CDC_DESC_LEN' was not declared in this scope
tinyusb_enable_interface(USB_INTERFACE_CDC, TUD_CDC_DESC_LEN, load_cdc_descriptor);
^~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:99:5: error: 'tinyusb_enable_interface' was not declared in this scope
tinyusb_enable_interface(USB_INTERFACE_CDC, TUD_CDC_DESC_LEN, load_cdc_descriptor);
^~~~~~~~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:101:49: error: 'ARDUINO_USB_EVENTS' was not declared in this scope
arduino_usb_event_handler_register_with(ARDUINO_USB_EVENTS, ARDUINO_USB_STOPPED_EVENT, usb_unplugged_cb, this);
^~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:101:49: note: suggested alternative: 'ARDUINO_USB_CDC_EVENTS'
arduino_usb_event_handler_register_with(ARDUINO_USB_EVENTS, ARDUINO_USB_STOPPED_EVENT, usb_unplugged_cb, this);
^~~~~~~~~~~~~~~~~~
ARDUINO_USB_CDC_EVENTS
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:101:69: error: 'ARDUINO_USB_STOPPED_EVENT' was not declared in this scope
arduino_usb_event_handler_register_with(ARDUINO_USB_EVENTS, ARDUINO_USB_STOPPED_EVENT, usb_unplugged_cb, this);
^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:101:69: note: suggested alternative: 'ARDUINO_USB_CDC_MAX_EVENT'
arduino_usb_event_handler_register_with(ARDUINO_USB_EVENTS, ARDUINO_USB_STOPPED_EVENT, usb_unplugged_cb, this);
^~~~~~~~~~~~~~~~~~~~~~~~~
ARDUINO_USB_CDC_MAX_EVENT
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp: In member function 'void USBCDC::_onLineState(bool, bool)':
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:229:37: error: 'RESTART_BOOTLOADER' was not declared in this scope
usb_persist_restart(RESTART_BOOTLOADER);
^~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:229:37: note: suggested alternative: 'XCHAL_HAVE_BOOTLOADER'
usb_persist_restart(RESTART_BOOTLOADER);
^~~~~~~~~~~~~~~~~~
XCHAL_HAVE_BOOTLOADER
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:229:17: error: 'usb_persist_restart' was not declared in this scope
usb_persist_restart(RESTART_BOOTLOADER);
^~~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:229:17: note: suggested alternative: 'esp_restart'
usb_persist_restart(RESTART_BOOTLOADER);
^~~~~~~~~~~~~~~~~~~
esp_restart
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp: In member function 'void USBCDC::_onLineCoding(uint32_t, uint8_t, uint8_t, uint8_t)':
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:258:33: error: 'RESTART_BOOTLOADER' was not declared in this scope
usb_persist_restart(RESTART_BOOTLOADER);
^~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:258:33: note: suggested alternative: 'XCHAL_HAVE_BOOTLOADER'
usb_persist_restart(RESTART_BOOTLOADER);
^~~~~~~~~~~~~~~~~~
XCHAL_HAVE_BOOTLOADER
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:258:13: error: 'usb_persist_restart' was not declared in this scope
usb_persist_restart(RESTART_BOOTLOADER);
^~~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:258:13: note: suggested alternative: 'esp_restart'
usb_persist_restart(RESTART_BOOTLOADER);
^~~~~~~~~~~~~~~~~~~
esp_restart
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp: In member function 'void USBCDC::_onRX()':
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:277:22: error: 'tud_cdc_n_read' was not declared in this scope
uint32_t count = tud_cdc_n_read(itf, buf, CONFIG_TINYUSB_CDC_RX_BUFSIZE);
^~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:277:22: note: suggested alternative: 'tud_cdc_rx_cb'
uint32_t count = tud_cdc_n_read(itf, buf, CONFIG_TINYUSB_CDC_RX_BUFSIZE);
^~~~~~~~~~~~~~
tud_cdc_rx_cb
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp: In member function 'virtual void USBCDC::flush()':
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:352:58: error: 'tud_cdc_n_connected' was not declared in this scope
if(itf >= MAX_USB_CDC_DEVICES || tx_lock == NULL || !tud_cdc_n_connected(itf)){
^~~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:352:58: note: suggested alternative: 'tud_cdc_tx_complete_cb'
if(itf >= MAX_USB_CDC_DEVICES || tx_lock == NULL || !tud_cdc_n_connected(itf)){
^~~~~~~~~~~~~~~~~~~
tud_cdc_tx_complete_cb
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:358:5: error: 'tud_cdc_n_write_flush' was not declared in this scope
tud_cdc_n_write_flush(itf);
^~~~~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp: In member function 'virtual int USBCDC::availableForWrite()':
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:364:58: error: 'tud_cdc_n_connected' was not declared in this scope
if(itf >= MAX_USB_CDC_DEVICES || tx_lock == NULL || !tud_cdc_n_connected(itf)){
^~~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:364:58: note: suggested alternative: 'tud_cdc_tx_complete_cb'
if(itf >= MAX_USB_CDC_DEVICES || tx_lock == NULL || !tud_cdc_n_connected(itf)){
^~~~~~~~~~~~~~~~~~~
tud_cdc_tx_complete_cb
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:370:16: error: 'tud_cdc_n_write_available' was not declared in this scope
size_t a = tud_cdc_n_write_available(itf);
^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp: In member function 'virtual size_t USBCDC::write(const uint8_t*, size_t)':
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:377:89: error: 'tud_cdc_n_connected' was not declared in this scope
if(itf >= MAX_USB_CDC_DEVICES || tx_lock == NULL || buffer == NULL || size == 0 || !tud_cdc_n_connected(itf)){
^~~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:377:89: note: suggested alternative: 'tud_cdc_tx_complete_cb'
if(itf >= MAX_USB_CDC_DEVICES || tx_lock == NULL || buffer == NULL || size == 0 || !tud_cdc_n_connected(itf)){
^~~~~~~~~~~~~~~~~~~
tud_cdc_tx_complete_cb
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:390:13: error: 'tud_cdc_n_connected' was not declared in this scope
if(!tud_cdc_n_connected(itf)){
^~~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:390:13: note: suggested alternative: 'tud_cdc_tx_complete_cb'
if(!tud_cdc_n_connected(itf)){
^~~~~~~~~~~~~~~~~~~
tud_cdc_tx_complete_cb
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:394:24: error: 'tud_cdc_n_write_available' was not declared in this scope
size_t space = tud_cdc_n_write_available(itf);
^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:396:13: error: 'tud_cdc_n_write_flush' was not declared in this scope
tud_cdc_n_write_flush(itf);
^~~~~~~~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:402:23: error: 'tud_cdc_n_write' was not declared in this scope
size_t sent = tud_cdc_n_write(itf, buffer+so_far, space);
^~~~~~~~~~~~~~~
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:402:23: note: suggested alternative: 'tud_cdc_rx_cb'
size_t sent = tud_cdc_n_write(itf, buffer+so_far, space);
^~~~~~~~~~~~~~~
tud_cdc_rx_cb
/Users/USERNAME/esp/esp-idf/components/arduino/cores/esp32/USBCDC.cpp:406:13: error: 'tud_cdc_n_write_flush' was not declared in this scope
tud_cdc_n_write_flush(itf);
No idea how to fix this since it's not an issue with any of my code but rather USBCDC.cpp (part of the board source)