0

RPi zero w v1.3 running RASPBIAN LITE stretch

I would like to use an ETH adapter to connect to the pi, but if I plug it before starting the system all works fine, while in case of hot-plug it causes a reset of the pi.

I think this depends on the power perturbation related to the usb insertion. I don't want to use an hub because my device is powered from a battery and I would like to have the ability to use ETH only when necessary to save power.

Is there a way to avoid this issue?

I tried also to set max_usb_current=1 in the /boot/config.txt but nothing changed in the behaviour.

Thanks in advance.

3

The Pi Zero W supports two different USB modes on its USB connector:

  1. USB Host mode, which is also called OTG mode (On-the-Go).
  2. USB device mode, which is also called gadget mode, but almost always incorrectly named OTG.

Unfortunately, the USB mode the Pi Zero W's USB electronics and connector cannot be changed on the fly, and thus no hotpluging possible which would also cause a change of the USB mode. The OTG mode is requested by shorting an additional fifth pin in the USB connector to GND (if I'm not mistaken). If this pin is left unshorted and thus floating, the USB electronics will be configured into USB slave mode.

Beware, changing the state of this OTG detection pin always does a hard reset without any warning (which is a pain in the back).

Still, USB hotplugging is still possible, but only if it does not change the state of the OTG detection pin. Unfortunately, power fluctuations when hotplugging a device may also cause an unexpected reboot, albeit the OTG pin was left as it was. This depends on the type of OTG shim/cable used, as well as how well your USB device behaves.

From my own experience with several Pi Zero Ws, different OTG cables and shims, and different USB devices I've some some combinations to work (almost) reliable, while others reliably cause reboots.

The Pi Zero W hasn't been designed for such usages (I think); even while the technical specs would be sufficient, better use the 3B(+) when you need reliable USB host functionality -- even if it needs more power, produces more heat, and takes up more space.

| improve this answer | |
  • Thanks for the reply. In my case I need only to power the peripheral (so I need to be in the HOST case) and I already used a specific plug (microB- to femaleA adapter) that forces the 5th pin to GND. It seems that the real issue could be related to the power fluctuations, but I would like to verify if the system detects an USB mode change request: is there a way to force the HOST MODE only to exclude the usb mode change failure? – user73736 Apr 16 '18 at 13:54
  • Unfortunately, there doesn't seem to be any way to configure this using a config file or OTF (one-time fuse). I suspect that comes from the originaly targetted education market, which differs from an embedded market and also sometimes from a maker market. – TheDiveO Apr 16 '18 at 14:31
  • Thank you. I will try to check if an external small circuit connected to the USB via an otg (host mode) cable could limit the Power fluctuations. If you have any suggestion I will appreciate. – user73736 Apr 16 '18 at 18:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.