2021-07-02 07:53 AM
2021-07-02 08:30 AM
How is the 'G0B1 different from any other STM32 in this regard?
There are simple USB-capable Disco boards out there (e.g. the 'F072 Disco), to serve as example.
JW
2021-07-02 12:23 PM
Your first question should be addressed to ST, not me. If they don't make it clear, then maybe they should.
Are you sure the disco is a good example of a self-powered design? Normally the USB driver senses Vbus somehow to detect if a host is attached (eg OLIMEX STM32F3). Unfortunately I'm using the 48 pin chip not the 64 as in this example.
2021-07-03 01:25 AM
That was a rhetorical question. While the 'G0Bx is the first to have the non-Synopsys device+host USB IP, from device point of view it does not differ from other non-Synopsys USB devices in STM32 which have the DP pullup integrated.
The usually cited concern over self-powered USB devices is this requirement from USB2.0 7.1.5:
The voltage source on the pull-up resistor must be derived from or controlled by the power supplied on the USB
cable such that when V BUS is removed, the pull-up resistor does not supply current on the data line to which it is
attached.
There's an additional related info in 7.2.1:
They [devices] may not provide power to the pull-up resistor
on D+/D- unless V BUS is present (see Section 7.1.5). When V BUS is removed, the device must remove power
from the D+/D- pull-up resistor within 10 seconds.
I'm not going to discuss the long history of USB standards violation in many of its aspects, nor the fact that should an upstream port withstand the pullup for 10 seconds it's highly unlikely it wouldn't withstand it for undefinite time, and that I'm yet to see an USB upstream port which can't sustain 3V/2mA into DP/DM when powered down. Sure, one should err on the safe side, and it's likely that should there be any formal USB testing it will look at this particular detail, too.
There is no dedicated VBUS input onto none of the non-Synopsys USB IP on none of STM32, so you simply use any GPIO input to detect presence of VBUS (after it being properly conditioned).
JW