2021-11-21 07:58 AM
Hi dear support people,
floating CMOS inputs in general pose both serious hardware and software problems, as we all are quite aware of.
Regardless, the D- line of the STM32H7 USB FS PHY (used as a USB device role) is floating, when the host USB cable is detached:
A slight touch of my finger at the D- line on a Nucleo H745ZI-Q will trigger PCD-Resume and PCD-Suspend callbacks in a high frequency! So this system is highly prone to fail any mandatory EMC compliance tests.
The only solution i know, would be weak pulldown resistors at both D+ and D- (well, at least at D- it seems inevitable?).
Neither has the eval board any weak pull resistor, nor takes the STM32 PHY hardware care of it, nor does the USB HAL, nor does the USB middleware, nor does the reference manual state that i have to take care of it myself. Well, maybe it's my fault to expect any of those...
So the best solution seems to activate the GPIO pull down function for both D+ and D-, as these ~40kOhm pulldowns probably wouldn't disturb the USB communication in any way. But pull down activation for D- and D- doesn't seem to work. The problem persists.
Please tell me that i missed something, and that i don't have to add external weak pull down resistors!?
Thanks in advance!
-Albert
2022-01-25 03:06 AM
Hello @AHoll.2 ,
Your issue has been raised internally. I will keep you updated.
Thank you for you contribution.
BeST Regards,
Walid
2022-01-25 04:01 AM
> floating CMOS inputs in general pose both serious hardware and software problems
You can/should mitigate the possible hardware problem by using an appropriate ESD protection device.
Otherwise you should write your software so that spurious bus transients pose no problem. If you have VBUS detect implemented, you can simply shut off USB entirely upon cable removal.
> pull down activation doesn't seem to work
The USB PHY takes precedence over GPIO settings (I wasn't aware of that it does this also for the pullups/pulldowns, but am not surprised). This is not documented by ST.
[EDIT] According to USB 2.0 Table 7-7. DC Electrical Characteristics, Input impedance exclusive of pullup/pulldown (for low-/full-speed) is min. 300kOhm. That's a couple of uA to reach the low/high level.
In other words, you can use an external pullup of 300kOhm on DM, but strong EMI (and surely finger touch) could inject such currents which simulate bus activity and result in Resume interrupt. So you have to cope with that in software anyway, if you don't have other way to detect cable disconnect. One way to tackle that might be to ignore the Resume interrupt for one or a couple of ms after each Suspend.
{/EDIT]
JW