Hello,
here is our setup:
SoftDevice 7.2.0, nrf52840
The problem:
Once the voltage on VBUS drops below 4.4V and there is active CDC ACM TX transmission (from device to host), the USBD stack becomes broken and unable to recover once the voltage recovers to a normal level. It means that it's no longer possible to send data over CDC ACM until you either reset the device or reset (stop&start) USB stack (this method not always working, so the only reliable method to recover is to reboot the device). Actually the same happens to HID (keyboard), but on the level of 4.0V and below. USB "removed" event is not fired in both cases.
Expected result:
The device (USB endpoint) has to be able to recover from the failed state, by clearing it's state and responding to the RESET_PIPE_AND_STALL packet from the host. While on the one hand, the documentation clearly states that the VBUS must be within 4.35-5.5V, on the other hand I believe the device has to have an ability to recover from this situation by resetting its internal state. As "the host" actually tries to reset the endpoint with RESET_PIPE_AND_STALL command, but the Nordic device while it is responding to the command with success, still unable to recover and fails in the loop. I'm attaching 2 *.pcapng files (it's possible to open them via Wireshark), which contains captured data between the device and the host - the one with normal functioning (when USB VBUS > 4.3V) and one with a problem.
P.S. this situation is not actually rare in the real world: for instance we installed our devices at POS (point of sale), which have outdated hardware with current output limit 0.5A + someone could touch the USB connector or the cable + the connector could be oxidized and so on and so forth. The problem might not reproduce for several weeks because of multiple factors, but it happens frequently. And our customer expects the hardware (Nordic based device) must not be unplugged\plugged in the system as it's not the case for their existing hardware, which is also working with USB (barcode scanners, payment terminals, etc). Of course the first thing we did - is to lower our power consumption, but as I mentioned before, there is still too much factors, which might reproduce the problem.
Steps to reproduce:
Software: Windows 10 PC, any serial port reader app (e.g. Putty), Wireshark (for USB packet sniffing) and CDC ACM example project. Then the voltage on VBUS has to be adjusted to ~4.3V or below and send something over the CDC ACM to the host. The second USB packet from the device to the host with data will not be delivered and the USB data transmission between host and the device will fail in the loop.
P.S. the simplest way to lower the voltage:
a) use very long USB cable, e.g. 4-6m or more
b) use external power supply, which could manually adjust voltage to the required level