Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@hyx0329
Copy link
Contributor

@hyx0329 hyx0329 commented Sep 22, 2025

ZMK doesn't use this. Disable this to prevent unexpected USB disconnection. The disconnection is observed under 3 circumstances on a Linux host:

  1. Keyboard just performed a firmware upgrade and USB is kept connected.
  2. Keyboard is woken from USB power source and USB is kept connected.
  3. Keyboard is connected when host is booting, and when Linux is just initialized. The keyboard is working in BIOS but not in the OS.

When keyboard is "disconnected", a re-plug is required to make USB work again. Disabling SOF processing eliminates this re-plug.

Test on Makerdiary M60 shows this change will not affect boot protocol switching.

PR check-list

  • Branch has a clean commit history
  • Additional tests are included, if changing behaviors/core code that is testable.
  • Proper Copyright + License headers added to applicable files (Generally, we stick to "The ZMK Contributors" for copyrights to help avoid churn when files get edited)
  • Pre-commit used to check formatting of files, commit messages, etc.
  • Includes any necessary documentation changes.

@hyx0329 hyx0329 requested a review from a team as a code owner September 22, 2025 04:09
ZMK doesn't use SOF. Disable this to prevent unexpected USB
disconnection. The disconnection is observed under 3 circumstances on a
Linux host:

1. Keyboard just performed a firmware upgrade and USB is kept connected.
2. Keyboard is woken from USB power source and USB is kept connected.
3. Keyboard is connected when host is booting, and when Linux is just
   initialized.

Disabling SOF processing will not affect boot protocol switching.

Tested on Makerdiary M60.
@hyx0329 hyx0329 force-pushed the fix-usb-disconnection branch from 2e7e3ec to 35967aa Compare September 22, 2025 04:24
@hyx0329 hyx0329 changed the title fix(usb): disable SOF processing fix(usb): Prevent unexpected USB disconnection caused by USB SOF Sep 22, 2025
@caksoylar caksoylar added core Core functionality/behavior of ZMK usb hid labels Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core functionality/behavior of ZMK hid usb

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants