1 2 Previous Next 16 Replies Latest reply on Dec 28, 2015 8:00 AM by KurtE

    USB Host mode from boot

    maeda

      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?

        • 1. Re: USB Host mode from boot
          rosenrot

          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.

          • 2. Re: USB Host mode from boot
            Intel_Peter

            Hello maeda,

             

            Have you tried something like this: 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

            • 3. Re: USB Host mode from boot
              rosenrot

              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.

              • 4. Re: USB Host mode from boot
                maeda

                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.

                • 5. Re: USB Host mode from boot
                  rosenrot

                  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

                  • 6. Re: USB Host mode from boot
                    Intel_Peter

                    Hello rosenrot,

                     

                    I was looking in the communities and I found this post: Intel Edison USB host mode, I thought I could help you.

                     

                    Regards,

                                Peter

                    • 7. Re: USB Host mode from boot
                      maeda

                      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.

                      • 8. Re: USB Host mode from boot
                        KurtE

                        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

                        • 9. Re: USB Host mode from boot
                          maeda

                          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.

                          • 10. Re: USB Host mode from boot
                            KurtE

                            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

                            • 11. Re: USB Host mode from boot
                              mmi

                              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.

                              • 12. Re: USB Host mode from boot
                                mweal

                                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)

                                • 13. Re: USB Host mode from boot
                                  KurtE

                                  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

                                  • 14. Re: USB Host mode from boot
                                    KurtE

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

                                    1 2 Previous Next