I would like to ask, what is the role of ESP32-S3 TinyuSB's VBUS monitoring, and what are the consequences of not monitoring VBUS for self powered devices? Will there be any issues with USB sending data if the USB cable is disconnected and reconnected without monitoring VBUS?
I made a self powered device using ESP32-S3 as the main chip and used it as a USB CDC device. I also set up monitoring VBUS pin during the installation of the tinyuSB driver. But there is still a situation where the data sent by USB to the PC cannot be displayed when reconnecting after USB disconnection. I am not sure what the reason is, can anyone help explain it?
About self-powered device VBUS monitor question
-
- Posts: 3
- Joined: Mon Aug 21, 2023 3:56 am
-
- Posts: 19
- Joined: Thu Oct 07, 2021 8:11 am
Re: About self-powered device VBUS monitor question
Hi,
The USB VBUS monitoring is only relevant for self-powered devices, that is devices that can operate even when there is no USB connection.
The consequence of NOT monitoring the VBUS, is that the device's software won't be able to distinguish between USB Suspend and USB disconnection. Suspend means that no data is send on the USB bus - typically used for power saving. Disconnection means that the device was unplugged from the USB port.
If your application does not care about this, you do not have to monitor VBUS (although that is AGAINST the USB specification). You can simply react on the Suspend callback from TinyUSB. Just define in your application.
Also please note that we have a regression in latest TinyUSB, that might affect your application, please follow the steps described there to used older version of TinyUSB https://github.com/espressif/esp-idf/issues/12360
The USB VBUS monitoring is only relevant for self-powered devices, that is devices that can operate even when there is no USB connection.
The consequence of NOT monitoring the VBUS, is that the device's software won't be able to distinguish between USB Suspend and USB disconnection. Suspend means that no data is send on the USB bus - typically used for power saving. Disconnection means that the device was unplugged from the USB port.
If your application does not care about this, you do not have to monitor VBUS (although that is AGAINST the USB specification). You can simply react on the Suspend callback from TinyUSB. Just define
Code: Select all
void tud_suspend_cb(bool remote_wakeup_en);
Also please note that we have a regression in latest TinyUSB, that might affect your application, please follow the steps described there to used older version of TinyUSB https://github.com/espressif/esp-idf/issues/12360
After the disconnection, no data can be send. You must wait until the USB is connected again to continue sending new dataBut there is still a situation where the data sent by USB to the PC cannot be displayed when reconnecting after USB disconnection.
Who is online
Users browsing this forum: VinayDand and 452 guests