ESP32-S3 CDC Decriptors

LarsMygh
Posts: 3
Joined: Sun Aug 01, 2021 9:19 pm

ESP32-S3 CDC Decriptors

Postby LarsMygh » Sat Jan 20, 2024 7:32 am

I am using the ESP_IDF standard "tusb_serial_device" example as a template for a project:

I have used the menuconfig since I want my own VID and PID so part of my sdkconfig looks something like this (obviously my info substituting the default Espressif VID, PID etc)

#
# TinyUSB Stack
#
CONFIG_TINYUSB_DEBUG_LEVEL=0

#
# TinyUSB task configuration
#
CONFIG_TINYUSB_NO_DEFAULT_TASK=y
# end of TinyUSB task configuration

#
# Descriptor configuration
#

#
# You can provide your custom descriptors via tinyusb_driver_install()
#
# CONFIG_TINYUSB_DESC_USE_ESPRESSIF_VID is not set
CONFIG_TINYUSB_DESC_CUSTOM_VID=0x1234
# CONFIG_TINYUSB_DESC_USE_DEFAULT_PID is not set
CONFIG_TINYUSB_DESC_CUSTOM_PID=0x5678
CONFIG_TINYUSB_DESC_BCD_DEVICE=0x0100
CONFIG_TINYUSB_DESC_MANUFACTURER_STRING="Espressif Systems"
CONFIG_TINYUSB_DESC_PRODUCT_STRING="Espressif Device"
CONFIG_TINYUSB_DESC_SERIAL_STRING="123456"
CONFIG_TINYUSB_DESC_CDC_STRING="Espressif CDC Device"
# end of Descriptor configuration

However when I used the standard code from the the example:
ESP_LOGI(TAG, "USB initialization");
const tinyusb_config_t tusb_cfg = {
.device_descriptor = NULL,
.string_descriptor = NULL,
.external_phy = false,
.configuration_descriptor = NULL,
};

the NULL pointers to 3 descriptors, the info from the sdkconfig does not seem to have any effect?

I have looked at the standard examples from the different USB types to copy, paste and configure.
Have anyone got an example of set of CDC descriptors/tinyusb_config_t const which works?

LarsMygh
Posts: 3
Joined: Sun Aug 01, 2021 9:19 pm

Re: ESP32-S3 CDC Decriptors

Postby LarsMygh » Thu Jan 25, 2024 8:31 pm

Have tested the "tusb_serial_device" example in the IDF. All seems to work fine. When using NULL descriptors, info is taking from the sdkconfig.

Question: Is possible to override the 'Serial Number' on start up? (Saving a Serial number into, say, Eeprom and loading it into the descriptor?

Who is online

Users browsing this forum: Google [Bot], ok-home and 42 guests