Closed jnk0le closed 9 months ago
That should certainly be documented and kept, and mentioned in the readme.
For actual USB devices, this is likely to be the standard way to do it. For bootloader-mode, it is unlikely we would want to do this, because user code may misconfigure the port.
Added https://github.com/cnlohr/rv003usb/pull/38 which makes USB_DPU
optional, so you can actually just hardwire D- with 1.5K to 3V3 and force D- low to re-enumerate. (edit: for the bootloader ;))
Any ideas how long D-
needs to be held low for re-enumeration? So far couldn't find anything about that in the USB specification. @jnk0le
typically (e.g. stm32duino) it's 10-20ms.
typically (e.g. stm32duino) it's 10-20ms.
I actually found the reference in the USB 2.0 Spec. A disconnect is recognized after only 2.5µs of SE0 (both data lines low). See TDDIS in Table 7-13 of Universal Serial Bus Specification Revision 2.0.
So 10ms is plenty.
Close issue now? The PR's been merged to make PU resistor is optional.
A trick from f103 usb stacks.
Instead of dedicating another gpio line for attaching by 1,5K resistor, you can tie this resistor to VCC and configure D- line to output logical low for certain amount of time to detach from the bus.
This detachment must be executed at least once and finish after everthing is initialized.