raspberrypi / firmware

This repository contains pre-compiled binaries of the current Raspberry Pi kernel and modules, userspace libraries, and bootloader/GPU firmware.
5.18k stars 1.68k forks source link

SD Card boot failure with ESCPOS printer connected via USB #1408

Open kolucciy opened 4 years ago

kolucciy commented 4 years ago

Is this the right place for my bug report? I believe so.

Describe the bug Pi4B won't boot with ESCPOS printer connected via USB. Printer works fine if connected straight after the boot.

To reproduce Plug the ESCPOS printer to one of the USBs and start Pi4B.

Expected behaviour Should boot normally.

Actual behaviour Hung with black screen. Red light on. No green light activity.

System

Logs None.

Additional context If printer is connected straight after the boot then all is good.

timg236 commented 4 years ago

Which bootloader version are you using 'vcgencmd bootloader_version' and is there anything on the HDMI screen. It might be worth attaching the printer via a powered USB hub.

kolucciy commented 4 years ago

@timg236

vcgencmd bootloader_version
Apr 16 2020 18:11:26
version a5e1b95f320810c69441557c5f5f0a7f2460dfb8 (release)
timestamp 1587057086

I am using 5.1V 3.5A power supply but can certainly try a powered USB hub.

timg236 commented 4 years ago

Thanks, that bootloader version does not support USB boot so it's looking more like a power/reset issue.

Does the failure occur if you connect the printer after booting then run "sudo reboot" ?

kolucciy commented 4 years ago

Just to confirm I'm booting of my SD card. Yeah, the failure occur if I run "sudo reboot". It just won't start again until i disconnect the printer.

kolucciy commented 4 years ago

It feels like its trying to USB boot of the printer.

timg236 commented 4 years ago

There's no USB code in that version of the bootloader :)

kolucciy commented 4 years ago

Found similar issue https://github.com/raspberrypi/firmware/issues/746#issuecomment-516158740 and it looks like I need to use powered hub :( https://github.com/raspberrypi/firmware/issues/746#issuecomment-516365596

pelwell commented 4 years ago

Thanks, that bootloader version does support USB boot

Does not ...?

timg236 commented 4 years ago

Found similar issue #746 (comment) and it looks like I need to use powered hub :( #746 (comment)

That bug was related to USB descriptor parsing, and as @pelwell says that version of the Pi 4 bootloader does not use USB. If there's nothing on the HDMI display then that would also suggest a power issue, which might be fixable with a powered hub.

kolucciy commented 4 years ago

I will order one and try but its far from ideal having a powered USB hub to power a USB device during the boot time considering the fact that it works fine after the boot.

pelwell commented 4 years ago

Boot time tends to be when the power draw is highest, partly because all the devices are being switched on and initialised and partly because systemd is so parallel, so if there were to be a power problem that is when you might expect to see it.

pelwell commented 4 years ago

But if the green light never even flickers then we can rule out systemd...

6by9 commented 4 years ago

This sounds similar to an old issue.

Comments from James A on a forum thread over a KVM switch that did a similar thing (solid red light, no activity) during alpha testing:

It's what I expected it was. On the Pi I can see that the hub/switch is leaking power into the unpowered Pi (3V3 line charges to ~800mV) which will stop the power management chip turning on (as it's designed to wait until all aupplies are less than 200mV, so it guarantees supply up-sequencing). it's not leaking through VBUS so it'll be (almost certainly) leaking via a pullup to the D+ USB line.

The hub/switch is therefore behaving incorrectly - as it should never apply a powered pull to an 'unpowered' USB host - usually a peripheral never can do this as the peripheral itself is powered from the host's VBUS.

So the short answer is it's understood, but probably not something we can or will fix.

An unpowered USB hub would probably mitigate the issue to as it should conform to the USB spec in regards what it does with the usptream USB port.