(Re)Boot breaking off when detecting USB device

Kernel:

Linux colibri-imx7-14720234 5.4.193-5.7.0+git.f78299297185 #1 SMP Mon Jul 11 14:42:03 UTC 2022 armv7l GNU/Linux

We have a probably badly behaving self powered USB device, that is ready while the kernel reboots. During reboot the boot process starts over. If i keep the USB device in reset, the boot is ok. I am not relly sure if this is a bug report - but it woukd add to kernel stability if it could survive this.

Output debug UART:

[ 1.741105] ehci_hcd: USB 2.0 ‘Enhanced’ Host Controller (EHCI) Driver
[ 1.749256] ehci-mxc: Freescale On-Chip EHCI Host driver
[ 1.756353] ehci-fsl: Freescale EHCI Host controller driver
[ 1.763477] usbcore: registered new interface driver usb-storage
[ 1.772941] imx_usb 30b10000.usb: No over current polarity defined
[ 1.780964] imx_usb 30b20000.usb: No over current polarity defined
[ 1.791430] ci_hdrc ci_hdrc.0: EHCI Host Controller
[ 1.797778] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[ 1.836197] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[ 1.843855] hub 1-0:1.0: USB hub found
[ 1.849055] hub 1-0:1.0: 1 port detected
▒▒

U-Boot 2020.07-5.7.0+git.1cbeecee44a8 (Jun 27 2022 - 13:27:02 +0000)

CPU: Freescale i.MX7D rev1.3 1000 MHz (running at 792 MHz)

Regards
Paul

Hi @BDSKPEF,

Isn’t it a power issue? Too deep voltage drop on supply rail? Could you try with lab power supply instead of PC USB port? Perhaps chip powered USB HUB with >0,5A current limit and shorter USB cable?

Edward

Hi Edward,
Thank you for your suggestions.
The USB device is self-powered and the +5V from USB connector is only used to pull-up the USB-P line to indicate device present and speed. But a powered HUB does the trick and boot is ok
I’ll try to measure any current consumption on the +5V.

Sorry, I mistakenly treated self powered as bus powered, power shouldn’t be an issue.

What is USB-P? USB DP? You shouldn’t use any pull resistors on DP/DM, iMX7 includes internal pull up/down’s, controllable according to USB role and mode.
Hm, if you have USB role set in device tree to “otg” instead of “peripheral”, then perhaps those external pull resistors lead to your error?

Hi,
there are no external resistors, i’m referring to the current consumption inside the USB device.

But we have detected a current draw immediately when the port is enabled - it should not be enough to reset the cpu module, as the same current draw happens when plugging the USB device after boot is completed … so i still think that the kernel should survive this. Talking against it is of course that the debug console output breaks off without any error message and boot starts ower.

We will look further into the mentioned current draw, as it should not be there as the device is self powered.

Regards Paul

Hi

What current are you talking about? Power supply current of your self powered device, which is irrelevant, o current from your USB host to VBUS pin of your Colibri carrier board? 2nd should be 5v/1500, (1500 - sum of voltage divider resistors suggested by Toradex desgn guide, 500+1000). There has to be either suggested divider or at least current limiting resistor of at least few kOhms, because internally 5V compliant VBUS pad is connected to 3V GPIO pad, which has internal diodes to 3V supply rails.

Edward

Hi @BDSKPEF !

Could you please share more information about your setup?

  • Which exact Colibri iMX7 module are you using? Please share its full name and version.
  • Which carrier board are you using? If it is Toradex’s please share the version as well.
  • Which USB device you are using? Compliant USB devices shouldn’t draw more than 0.5A.
  • Which power supply you are using? Maybe the point of failure of your boot is actually the lack of power supply capacity?

Best regards,

Problem was resolved by better 5V and limiting the start current from the USB device.
(marked solved Oct. 20.)
The limits to activate a reset should not have been reached, but of course we have not measured the voltage internally on the Colibri.

The hardware versions as requested:
Col iMX7D 512M V1.1D
Viola V1.2B
USB device is Atmel SAM7X512 mcu with custom firmware (draws less than 100mA)
“CUI Inc” 5V 1.2A (does shortly drop to 4.5V due to inline resistor for current measurement)

Ethernet connected
USB connected to the device mentioned
Uart A connected to PC via SP3232 TTL3V converter

Hi @BDSKPEF

Ok!

Thanks!

Best regards,