Esp32S3 : Is it possible to switch between USB CDC and MSC at runtime ?

ThomasESP32
Posts: 281
Joined: Thu Jul 14, 2022 5:15 am

Esp32S3 : Is it possible to switch between USB CDC and MSC at runtime ?

Postby ThomasESP32 » Mon Sep 22, 2025 1:55 pm

Good afternoon,


I am working with an Esp32S3 and I have found the example CDC MSC composite which works fine.
Now, I would like to know if it is possible to switch between CDC and MSC at runtime ?
If the answer is YES, is there any example ??

Best regards,

Thank you for your help,

Thomas TRUILHE

tore-espressif
Espressif staff
Espressif staff
Posts: 28
Joined: Thu Oct 07, 2021 8:11 am

Re: Esp32S3 : Is it possible to switch between USB CDC and MSC at runtime ?

Postby tore-espressif » Mon Oct 13, 2025 8:55 am

No, not out-of-the box. We use TinyUSB as our USB device stack, which uses static configuration.

You can implement this feature by defining your own tud_descriptor_configuration_cb() and tud_descriptor_device_cb() TinyUSB callbacks. In the callbacks you can then return whatever configuration you want.

Who is online

Users browsing this forum: Amazon [Bot], Qwantbot, Semrush [Bot] and 19 guests