2 Replies Latest reply on Jan 22, 2016 7:38 AM by ehren_m

    Disabling power to usb otg port - can we rely on "bug" where hostmode initialized on every OTHER reboot

    ehren_m

      Hello,

       

      We're developing a product involving the edison and a few usb devices connected via a usb hub. Our setup has the edison connected to the sparkfun base block and we power the edison from a usb battery connected to the console port (via the sparkfun block). A usb hub is attached to the otg port (with devices attached to the hub).

       

      The issue with usb host mode being inactive on every other reboot has been discussed in many places e.g.:

       

      Re: USB Host mode from boot

       

      However in our case, this behaviour is actually useful (in that I can toggle the power to the usb hub by rebooting the board). This is a "poor man's usb low power mode".

       

      My question is can I rely on this behaviour? Or can anyone suggest an alternative way to disable power draw from the usb otg port? (it's OK if I have to reboot in order to re-enable usb host mode). Perhaps I could achieve this by adding "nousb" to the kernel boot flags?

        • 1. Re: Disabling power to usb otg port - can we rely on "bug" where hostmode initialized on every OTHER reboot
          PabloM_Intel

          Hi ehren_m,

           

          This issue is still being worked on, so I guess you still could use it to your “advantage”, even if that’s not the purpose of it. I would suggest you to run some reliability tests to see if on every reboot your get the same behavior. However, the idea is to have this issue solved at some point, possibly in a future image. In that case you’ll have to keep your older image with the issue still running. I’m not sure if your application involves a long term use, but if that’s not the case go ahead and make use of it.

           

          Regards,

          PabloM_Intel

          • 2. Re: Disabling power to usb otg port - can we rely on "bug" where hostmode initialized on every OTHER reboot
            ehren_m

            Thanks for your help @Pablo_Intel

             

            I have found that the bug reliably results in no power to the otg on every other reboot.

             

            However, I've also found a way to programmatically ensure no power to the otg (requires reboot) - for the event the bug is fixed. It's somewhat hackish but works. Steps:

             

            cd /lib/modules/3.10.17-poky-edison+/kernel/drivers/usb/gadget/

            mv g_multi.ko g_multi.ok-blah # undo rename to re-enable powering of otg on boot

             

            The above steps also require that I

            systemctl disable sshd.socket

             

            Otherwise the boot waits for 2 mins (for hardware that won't appear)

            (so no ssh access to board which is ok for my purposes)

             

            -----

             

            I'm still interested in a method to disable power to the OTG while the Edison is still running. However I will follow this up with another thread.