# USB Disconnect

**URL:** <https://forums.sifive.com/t/usb-disconnect/5175>\
**Category:** HiFive Unmatched\
**Created:** [September 12, 2021, 3:10am UTC](https://forums.sifive.com/t/usb-disconnect/5175 "2021-09-12T03:10:12Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![pierce](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/pierce/32/1261_2.png) [@pierce](https://forums.sifive.com/u/pierce)\
**Post date:** [September 12, 2021, 3:10am UTC](https://forums.sifive.com/t/usb-disconnect/5175/1 "2021-09-12T03:10:12Z")

</div>

I’ve got a strange issue which

- I don’t know what’s causing it, and
- I don’t know how to reliably reproduce.

Every now and then during use, the USB will just completely die and will not come back up until a reboot comes along.

A potentially similar issue I’ve got is during boot up, my mouse does not initialise and requires replugging in.

I’m happy to provide more information. I just have no idea if this a hardware issue or software.

I have a small gut feeling that it is the Unmatched trying to sleep, and subsequently has disconnected the keyboard and mouse. I’ve disabled the anything I could find regarding sleep timeouts in the Gnome control centre, but alas to no avail.

---

<div class="post-metadata">

**Author:** ![jimw](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jimw](https://forums.sifive.com/u/jimw)\
**Post date:** [September 12, 2021, 4:52am UTC](https://forums.sifive.com/t/usb-disconnect/5175/2 "2021-09-12T04:52:03Z")

</div>

There is a known issue documented in the Freedom-u-sdk release notes with some suggestions on how to work around.  
[https://github.com/sifive/freedom-u-sdk/blob/2021.08/ReleaseNotes/2021.08.md#known-issues](https://github.com/sifive/freedom-u-sdk/blob/2021.08/ReleaseNotes/2021.08.md#known-issues)  
The item #6 mentioned is actually item #3 now. I reported that internally.

This is also mentioned in the HiFive Unleashed Software Reference Manual which can be found on the HiFive Unmatched board page.  
[https://www.sifive.com/boards/hifive-unmatched](https://www.sifive.com/boards/hifive-unmatched)  
This suggests another workaround. This is section 8.11.

This problem primarily affects HID I think, e.g. keyboard and mouse.

---

<div class="post-metadata">

**Author:** ![enthusi](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@enthusi](https://forums.sifive.com/u/enthusi)\
**Post date:** [September 12, 2021, 8:16am UTC](https://forums.sifive.com/t/usb-disconnect/5175/3 "2021-09-12T08:16:48Z")

</div>

I noticed that as well. Close to unusable with a HUB (to which I had mouse + KB attached) but it works ‘better’ when attaching both individually. For me a simple unplug/replug solves the issue every time. It remains annoying though. Using freedrom-u-sdk 2021.06.

---

<div class="post-metadata">

**Author:** ![vmedea](https://avatars.discourse-cdn.com/v4/letter/v/3be4f8/32.png) [@vmedea](https://forums.sifive.com/u/vmedea)\
**Post date:** [September 12, 2021, 2:19pm UTC](https://forums.sifive.com/t/usb-disconnect/5175/4 "2021-09-12T14:19:34Z")

</div>

> [@enthusi](#):
>
> For me a simple unplug/replug solves the issue every time.

I’ve noticed exactly same

- It happened a lot back when I used a wireless keyboard/mouse combo. It would just stop responding until reconnect.
- Now with a separately, directly connected (and wired) keyboard and mouse, it almost never happens. ~~I only remember having to replug after reboot.~~ Ok, it keeps happening. When it happens:
  - The device still shows up in `lsusb`
  - The device stlll shows up in `evtest`. However, no events appear when keys are pressed.
  - It’s still powered (leds are on)
  - I checked raw bus traffic using `cat /sys/kernel/debug/usb/usbmon/1u` (where the device is connected to bus 1). Nothing at all.

- Replugging always solved the issue (for at least a few minutes, usually longer) for me, I’ve never had USB crash completely until a reboot.
- I’ve only ever noticed it with HID devices (mouse, keyboard, but also with a Wacom drawing tablet), not with other USB-connected devices such as UARTs, even on the same bus as the hanging device!

Edit: I’ve connected a PCI-e USB controller, let’s see if it happens with that too or not.

---

<div class="post-metadata">

**Author:** ![Olorin](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/olorin/32/1380_2.png) [@Olorin](https://forums.sifive.com/u/Olorin)\
**Post date:** [September 14, 2021, 8:34pm UTC](https://forums.sifive.com/t/usb-disconnect/5175/5 "2021-09-14T20:34:01Z")

</div>

I have this issue, if you plug your device into the first USB port it will not happen. This only occurs on the second, third, and fourth ports.

I have my keyboard plugged into the first port and it never disconnects, the mouse is another story but I chose to prioritize the keyboard.

---

<div class="post-metadata">

**Author:** ![vmedea](https://avatars.discourse-cdn.com/v4/letter/v/3be4f8/32.png) [@vmedea](https://forums.sifive.com/u/vmedea)\
**Post date:** [September 16, 2021, 12:59pm UTC](https://forums.sifive.com/t/usb-disconnect/5175/6 "2021-09-16T12:59:38Z")

</div>

> [@Olorin](#):
>
> I have this issue, if you plug your device into the first USB port it will not happen. This only occurs on the second, third, and fourth ports.

That’s an interesting find! I didn’t notice yet that the ports are numbered

 ![unmatched-usbports](https://us1.discourse-cdn.com/flex020/uploads/sifive/original/2X/7/75c15c749bc537d954e00ec68c5114ddf5b03ee5.jpeg)

Looking at the topology shown in `lsusb -t`,

- Plugging the keyboard into port marked “0”

```auto
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
    |__ Port 1: Dev 15, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
    |__ Port 1: Dev 15, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M

```

- Plugging the keyboard into port marked “1”

```auto
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
    |__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 3: Dev 14, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 3: Dev 14, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M

```

- Plugging the keyboard into port marked “2”

```auto
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
    |__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 2: Dev 16, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 2: Dev 16, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M

```

- Plugging the keyboard into port marked “3”

```auto
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
    |__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 17, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 1: Dev 17, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M

```

There’s a clear difference between the first port (I assume you mean port 0), which is connected directly to the root hub and the rest, which is nested behind a hub. I wonder if this explains the difference in behavior.

---

<div class="post-metadata">

**Author:** ![Olorin](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/olorin/32/1380_2.png) [@Olorin](https://forums.sifive.com/u/Olorin)\
**Post date:** [September 16, 2021, 1:37pm UTC](https://forums.sifive.com/t/usb-disconnect/5175/7 "2021-09-16T13:37:17Z")

</div>

Yes, first port meaning port 0. I think you’re right about the reason for the difference.

If there is a hardware issue with the onboard hub for ports 1,2, and 3 maybe this can be bypassed by hooking up a known working external hub on port 0 and plugging both mouse and keyboard into that?

---

<div class="post-metadata">

**Author:** ![enthusi](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@enthusi](https://forums.sifive.com/u/enthusi)\
**Post date:** [September 17, 2021, 12:25pm UTC](https://forums.sifive.com/t/usb-disconnect/5175/8 "2021-09-17T12:25:04Z")

</div>

I would really appreciate any solutions in that area. I use the unmatched as desktop. Sharing screen with the laptop and the disconnects really limit the fun (that original fan sure also did but it’s okay with a 40mm one now)…  
So whoever finds something has my eternal gratitude.

---

<div class="post-metadata">

**Author:** ![X512](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/x512/32/1343_2.png) [@X512](https://forums.sifive.com/u/X512)\
**Post date:** [September 17, 2021, 2:53pm UTC](https://forums.sifive.com/t/usb-disconnect/5175/9 "2021-09-17T14:53:17Z")

</div>

3 ports (USB 3 boot disk, keyboard, mouse) works fine for me on Haiku. Port numbered “1” cause some troubles (stall etc.).

---

<div class="post-metadata">

**Author:** ![vmedea](https://avatars.discourse-cdn.com/v4/letter/v/3be4f8/32.png) [@vmedea](https://forums.sifive.com/u/vmedea)\
**Post date:** [September 17, 2021, 8:15pm UTC](https://forums.sifive.com/t/usb-disconnect/5175/10 "2021-09-17T20:15:22Z")

</div>

> [@enthusi](#):
>
> So whoever finds something has my eternal gratitude.

The ‘nuclear option’ would be to connect a different USB controller through PCI-e (like i did in [M-2 E key to PCI-e + USB2 adapter - #8 by vmedea](https://forums.sifive.com/t/m-2-e-key-to-pci-e-usb2-adapter/5166/9)), or running USB via an external host through usbip.

Something I haven’t been able to try yet is whether the `/sys/devices` unbind-bind sequence described here works: [keyboard - USB slots stop working suddenly from time to time - Ask Ubuntu](https://askubuntu.com/questions/206614/usb-slots-stop-working-suddenly-from-time-to-time) If it would at least be possible to unstuck the USB without having to physically replug it’d save some frustration, and could ostensibly even be done automatically, if the situation can be detected.

---

<div class="post-metadata">

**Author:** ![xeno](https://avatars.discourse-cdn.com/v4/letter/x/e19b73/32.png) [@xeno](https://forums.sifive.com/u/xeno)\
**Post date:** [July 12, 2025, 11:20am UTC](https://forums.sifive.com/t/usb-disconnect/5175/11 "2025-07-12T11:20:03Z")

</div>

Years later, there is still no fix for this other then repluging devices?

---

<div class="post-metadata">

**Author:** ![trev5](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@trev5](https://forums.sifive.com/u/trev5)\
**Post date:** [February 25, 2026, 11:39pm UTC](https://forums.sifive.com/t/usb-disconnect/5175/12 "2026-02-25T23:39:11Z")

</div>

Correct. Years later still no other fix than disconnect/reconnect.  
Approaches:

ssh into the machine and do the usb reconnect script

usb a usb or kvm switch (approx $30) to be able to electrically plug/unplug without physical cable removal

I’ve got an external kvm with mouse+keyboard and this is not functional on:

1. internal M.2 E-key usb hub
2. port 3 (usb 3.0)
3. port 1 (usb 2.0)
4. port 2 (usb 2.0)

I will be trying another kernel than linux to see if it’s a driver issue.
