Reset USB host without flashing eMMC

Is it possible to reset the USB host from software? My USB host is on the fritz after a hard shutdown (for the second time). If not, is there a way to have a battery connected to the Beaglebone Black but still have the BBB start up when 5V DC power is applied? One constraint is that this is a project in a housing and there’s limited space for a whole new set of battery-related wiring.

I have a BBB with Ubuntu installed (the 7-22 image). After some hard shutdowns, the USB host no longer works. Flashing the eMMC solves the issue, but a few hard shutdowns later and it fails.

I’m using the BBB in an embedded project where there isn’t access to the user boot button and the USB host is required for audio output. I tried to install a battery as was done here http://www.element14.com/community/community/knode/single-board_computers/next-gen_beaglebone/blog/2013/08/10/bbb--rechargeable-on-board-battery-system , but when I shutdown in the software (sudo shutdown -h now) and removed all other power, the board still showed the power light and an LED connected to sys_5V stayed on. That would be fine, but when I reconnected the DC power, the board wouldn’t start.

In playing with the battery, I accidentally bumped it, there was a hard shutdown, and now my USB host is again corrupted. Is there a way in Ubuntu to somehow reset the USB host? What part of it could become corrupted? I don’t know much about what logs are required for troubleshooting, but lsusb on the BBB gives

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The BBB with USB host problems has an audio USB adapter and I have a second BBB with a wireless adapter. I checked the syslogs of each and the BBB with problems is missing some lines from startup that the other device has:

Jan 1 00:05:25 arm kernel: [ 2.803283] mmcblk0boot0: unknown partition table
Jan 1 00:05:25 arm kernel: [ 2.874388] usb 1-1: default language 0x0409
Jan 1 00:05:25 arm kernel: [ 2.875052] usb 1-1: udev 2, busnum 1, minor = 1
Jan 1 00:05:25 arm kernel: [ 2.875079] usb 1-1: New USB device found, idVendor=7392, idProduct=7811
Jan 1 00:05:25 arm kernel: [ 2.882139] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jan 1 00:05:25 arm kernel: [ 2.889628] usb 1-1: Product: 802.11n WLAN Adapter
Jan 1 00:05:25 arm kernel: [ 2.894666] usb 1-1: Manufacturer: Realtek
Jan 1 00:05:25 arm kernel: [ 2.898978] usb 1-1: SerialNumber: 00e04c000001
Jan 1 00:05:25 arm kernel: [ 2.904390] usb 1-1: usb_probe_device
Jan 1 00:05:25 arm kernel: [ 2.904420] usb 1-1: configuration #1 chosen from 1 choice
Jan 1 00:05:25 arm kernel: [ 2.904600] usb 1-1: adding 1-1:1.0 (config #1, interface 0)
Jan 1 00:05:25 arm kernel: [ 2.905591] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
Jan 1 00:05:25 arm kernel: [ 2.905646] hub 1-0:1.0: port 1 enable change, status 00000503

These lines were in the middle of the following 8 lines (timestamps are off because these lines are from the flaky BBB):
Jul 23 02:20:20 arm kernel: [ 2.760671] mmcblk0boot0: mmc1:0001 MMC02G partition 1 1.00 MiB
Jul 23 02:20:20 arm kernel: [ 2.766949] slave hdmi.12: modes-blacklisted #1 → 832x624@75
Jul 23 02:20:20 arm kernel: [ 2.773376] mmcblk0boot1: mmc1:0001 MMC02G partition 2 1.00 MiB
Jul 23 02:20:20 arm kernel: [ 2.781421] of_get_named_gpio_flags: can’t parse gpios property
Jul 23 02:20:20 arm kernel: [ 2.781451] tilcdc 4830e000.fb: No power control GPIO
Jul 23 02:20:20 arm kernel: [ 2.789420] mmcblk0: p1 p2
Jul 23 02:20:20 arm kernel: [ 2.799098] mmcblk0boot1: unknown partition table
Jul 23 02:20:20 arm kernel: [ 2.811559] mmcblk0boot0: unknown partition table

Thanks very much for your help!

Software can turn the power off to the USB connector and turn it back on. Not sure if that will solve your problem, but it can be done. A USB reset is a USB transaction. If your device has gone on the fritz, I am not sure it would see any messages at all.

You can add a battery as indicated in the System Reference Manual. When you apply DC it will automatically switch to DC power.

Gerald

By installing libusb-dev and running the program described here: http://www.clearchain.com/blog/posts/resetting-the-usb-bus-under-linux , I successfully reset the USB host and now the board is working. However, I’d still prefer to use a battery. I added the battery exactly as described in the system manual, but my problem is that the system would not when DC power was supplied. Is it true that a WAKEUP
signal is sent by the TPS65217C only if power is completely disconnected and reconnected? Is there a way to trigger the beaglebone wakeup without removing battery power but also without having access to any of the physical buttons on the board?

Thanks much ,
Arthur

You need to check the datasheet for the TPS65317C for information on how all that works. Some of it is based on the settings that the SW programs into the device at power up.

Gerald