Community
cancel
Showing results for 
Search instead for 
Did you mean: 
idata
Community Manager
2,932 Views

USB Host mode from boot

My edison recognize USB host cable and USB-HUB when re-pluged USB host cable.

But not recognize first time plugged from power on. lsusb reports "-99".

I found USB ID pin is key. I cut pattern and add slide switch, on-off-on action is same to replug.

But I want automatically do it, because it used in embedded application.

I think some command like "modprobe" or so, causes virtual replug(USB ID on/off).

What command?

Tags (1)
0 Kudos
16 Replies
MMich22
New Contributor II
376 Views

I also would be interested in a software solution. So far I connected the ID pin to the centered pin of the transistor near the green led. Just works.

Pedro_M_Intel
Employee
376 Views

Hello maeda,

Have you tried something like this: http://billauer.co.il/blog/2013/02/usb-reset-ehci-uhci-linux/ http://billauer.co.il/blog/2013/02/usb-reset-ehci-uhci-linux/

If you are able to make it work, I invite you to share your results in the community.

Regards,

Peter

MMich22
New Contributor II
376 Views

Hi Peter,

from what I see, your proposed method requires the usb devices to be registered already. Unfortunately this is not the case. If there is a OTG cable attached from boot, there is no usb bus registered. For this reason the command lsusb does not return anything.

I tried to unbind the dwc3_otg but that results in a kernel panic.

Further ideas are welcome.

idata
Community Manager
376 Views

Peter, Thank you for information.

This morning, BEFORE trying this method, My edison recognize usb devices from boot!

I don't know why it solved.

Sorry I cannot report this is valid or no at this time.

MMich22
New Contributor II
376 Views

Hi Peter,

is it the case everytime? I see this working only from time to time.

When it is not working I get:

root@ubilinux:~# lsusb

unable to initialize libusb: -99

Pedro_M_Intel
Employee
376 Views

Hello rosenrot,

I was looking in the communities and I found this post: , I thought I could help you.

Regards,

Peter

idata
Community Manager
376 Views

I found ID=L and VBUS=H condition at boot causes problem.

Once problem occurs, VBUS toggling not solve problem.

But ID toggling solves problem.

I don't know why.

You need ID toggling (by some GPIO) mechanism or VBUS switching (by PSW pin) mechanism.

Breakout board has VBUS switching mechanism(by U36 MIC2039).

But some external USB device with OTG cable that provide VBUS=H (or VBUS leakage) causes problem.

Finally I selected faking Edison's VBUS pin on my system.

I disconnect Edison's VBUS(20) from USB's VBUS,

and connect PSW(21) directly.

mweal1
New Contributor III
376 Views

maeda wrote:

I found ID=L and VBUS=H condition at boot causes problem.

Once problem occurs, VBUS toggling not solve problem.

But ID toggling solves problem.

I don't know why.

Does anyone know if there is a software fix for this. My design relies on this mode of operation (host mode with power aka ACA)

KEckh
Valued Contributor III
376 Views

I thought I remember seeing some posting within the last week or so, that talked about setting some system setting that forced the processor to always do a cold boot. My problem is I don't remember the context of the message nor if it was on this forum or on the Odroid forum.

So wondering is there a setting to force the kernel to always do a cold boot and I would that help in this case?

Kurt

KEckh
Valued Contributor III
376 Views

I believe the setting was: /sys/module/intel_mid/parameters/force_cold_boot

aedwa2
New Contributor III
376 Views

This post is old but the problem is not solved in my case. I only care about the cold boot case because this is an embedded application and "reboot" is toggle the power switch. I want to use a non powered hub. I can do that as long as there is nothing plugged into the hub. But with two loads (usb-rs232 cables), the boot fails and Edison will continuously start the boot over. If I wait until boot to plug in everything then it works. It seems to be load dependent. With an older hub, that probably draws more power, I can't even boot with an empty hub.

However, I tried powering the edison from a 12V battery instead of my bench power supply. The bench supply is limited to 500mA and while that is more than enough to power everything it apparently is not enough to supply the instantaneous demands of powering up the hub with everything plugged in. The result of using the battery instead of the bench supply was that it works.

KEckh
Valued Contributor III
376 Views

Sorry, I don't think I can help much here. I have not been doing much lately with my Edisons. Hopefully someone from Intel or the community can give a better answer.

However it does sound like you have a brown out, with your bench supply. Obviously the easiest solution would be to use a wallwart with more power. Most of the time I use ones that are at least 2 amp... On my robots, I use either a 5 or 10 amp power supply...

Might help to have additional information, like is the USB hub powered? My guess probably not? Also when you say two USB RS232 cables, is there something plugged into these? Are they powered by the cable?

You might try different USB hubs. Sometimes I had better luck with really basic (dumb) ones, other times some of the newer ones did not apply power to the USB ports until it received a valid USB signal on the source usb connection. Many times this is fine, but in one case it did not work for me, as I connected the Edison both as a source and destination (easy way to get the +5vs to run it), but that did not work with smarter hubs...

Good luck and again I hope someone else has a more complete answer.

KEckh
Valued Contributor III
376 Views

Today was the first day that I have tried using the Edison mini breakout board with host usb.

If I power up the Edison using external 12v wall wart to digikey power connector (from hardware guid) with the Host mode adapter installed, the USB device(s) appear to come up and work.

However if I then try to reboot the processor while the USB devices are attached they don't work. lsusb gives the error -99...

I am using one of the adapters from digikey(839-1105-ND) that was called out in the hardware guide.

My last test was done using a USB sound card and a USB2AX device (atmega 32u2 device) Note: I also used the same setup on the Edison, Which I believe works on either type of boot.

Kurt

idata
Community Manager
376 Views

Kurt, I think your USB device provide VBUS power from boot.

It causes lsusb -99.

Unplug/Replug USB Cable.

Or shut VBUS powering on boot.

KEckh
Valued Contributor III
376 Views

Thanks, not sure what you are saying.

That is the only power coming in to this, is from the 12v power that I am feeding to the Edison mini-breakout board. As I mention it appears to work on a cold power up, but does not work on reboot with it powered up. But does work when I turn off the hub (no external power applied)

After boot, I then turn on switch and they show up as valid devices.

Some of the differences I see in dmesg output include;

When I do this from a complete powerup, I see:

[ 6.098598] hub 2-0:1.0: USB hub found [ 6.098642] hub 2-0:1.0: 1 port detected [ 6.161296] pmic_ccsm pmic_ccsm: USB VBUS Detected. Notifying OTG driver [ 6.216501] systemd-journald[107]: Received request to flush runtime journal from PID 1 [ 6.413643] usb 1-1: new high-speed USB device number 2 using dwc3-host [ 6.435448] usb 1-1: New USB device found, idVendor=05e3, idProduct=0608 [ 6.435479] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 6.435502] usb 1-1: Product: USB2.0 Hub [ 6.449950] hub 1-1:1.0: USB hub found [ 6.450315] hub 1-1:1.0: 4 ports detected [ 6.717791] EXT4-fs (mmcblk0p5): mounted filesystem without journal. Opts: discard,barrier=1,data=ordered,noauto_da_alloc [ 6.723869] usb 1-1.2: new full-speed USB device number 3 using dwc3-host [ 6.745834] usb 1-1.2: New USB device found, idVendor=16d0, idProduct=06a7 [ 6.745866] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=220 [ 6.745887] usb 1-1.2: Product: USB2AX [ 6.745906] usb 1-1.2: Manufacturer: Xevelabs [ 6.745925] usb 1-1.2: SerialNumber: 74031303437351D02210 [ 6.748577] usb 1-1.2: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes [ 6.769812] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device [ 6.853644] usb 1-1.4: new full-speed USB device number 4 using dwc3-host [ 6.874698] usb 1-1.4: New USB device found, idVendor=0d8c, idProduct=000e [ 6.874730] usb 1-1.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 6.874752] usb 1-1.4: Product: Generic USB Audio Device [ 7.423062] usbcore: registered new interface driver snd-usb-audio

When I do a reboot with the devices still connected I see:

6.011983] hub 2-0:1.0: USB hub found

[ 6.012029] hub 2-0:1.0: 1 port detected

[ 6.012671] dwc3-host dwc3-host.2: remove, state 1

[ 6.012714] usb usb2: USB disconnect, device number 1

[ 6.013275] xHCI xhci_drop_endpoint called for root hub

[ 6.013296] xHCI xhci_check_bandwidth called for root hub

[ 6.025413] dwc3-host dwc3-host.2: USB bus 2 deregistered

[ 6.028264] dwc3-host dwc3-host.2: remove, state 1

[ 6.028312] usb usb1: USB disconnect, device number 1

[ 6.028958] xHCI xhci_drop_endpoint called for root hub

[ 6.028979] xHCI xhci_check_bandwidth called for root hub

[ 6.029971] dwc3-host dwc3-host.2: USB bus 1 deregistered

It is not a complete killer for me, as if I use one of these boards on the robot, most of the time I will be starting up by power switch, but would be nice for it to just work regardless.

Thanks again

MMied
New Contributor III
376 Views

Hello to all,

here the same, after a coldstart or replugin it works well but after a 'warm' reboot it doesn't switch to hostmode.

In my opinion this is a kernel inadequateness, it misses a proper reinitialization of usb.

Reply