Turn USB power off/on with BeagleBone Black kernel >= 3.8

后端 未结 1 1723
一生所求
一生所求 2021-02-04 11:09

I need to:

  • turn off -> sleep some seconds -> turn on the USB power of beaglebone black

to be able to hardware-reset a device that is connected to US

相关标签:
1条回答
  • 2021-02-04 11:40

    Thanks to my friend Cleiton Bueno http://cleitonbueno.wordpress.com/ that found this solution for me:

    prerequisites:

    • apt-get install devmem2

    Code that solved the problem:

    devmem2 0x47401c60 b 0x00
    sleep 1
    echo "usb1" > /sys/bus/usb/drivers/usb/unbind
    sleep 20
    echo "usb1" > /sys/bus/usb/drivers/usb/bind
    sleep 1
    devmem2 0x47401c60 b 0x01
    

    The "devmem2" command is responsible to direct access GPIO3_13 of the beaglebone, that controls the IC that powers on/off the USB port.

    The "unbind/bind" commands are responsible to tell the usb driver to "rescan" the port after the power.

    0 讨论(0)
提交回复
热议问题