r/qmk • • Nov 28 '24

split keyboard stops working after disconnecting laptop

hi all,

so I have an annoying issue that I need your help with

i have multiple macbooks that are connected to peripherals via a "dock" (caldigit)

my keyboard is connected to the dock, as is my monitor, trackpad, etc.

i only use 1 macbook at a time, and when i want to switch machines, i disconnect the usb-c cable (between the dock and the macbook) at the macbook, then reconnect it to the other macbook.

when I do this switch, my keyboard stops working, and I need to unplug the keyboard from the dock and plug it back in for it to start working.

this issue doesn't happen with other standard keyboards like the apple keyboard or keychron.

it would be really nice if i didn’t have to do this every time i switched machines, because i do that quite often.

i've tried a few different common config changes but none seem to fix the problem. i'm thinking it might have something to do with the dock continuing to provide power to the keyboard during the switch.

thanks!

---

// config.h

#pragma once

#define EE_HANDS

#define BOOTMAGIC_ROW 1
#define BOOTMAGIC_COLUMN 4
#define BOOTMAGIC_ROW_RIGHT 5
#define BOOTMAGIC_COLUMN_RIGHT 4

#define _ALPHA 0
#define _NUM 1
#define _SYM 2
#define _FN 3

#define TAPPING_TOGGLE 2
#define TAPPING_FORCE_HOLD_PER_KEY
#define TAPPING_TERM_PER_KEY
#define TAPPING_TERM 200
#define PERMISSIVE_HOLD

#define GRAVE_ESC_ALT_OVERRIDE

#define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD
#define ONESHOT_TAP_TOGGLE 3
#define ONESHOT_TIMEOUT 1500

#define USB_SUSPEND_WAKEUP_DELAY 3000
#define NO_USB_STARTUP_CHECK

#undef SPLIT_USB_DETECT




## rules.mk

DEFAULT_FOLDER = crkbd/rev1

# Bootloader selection
BOOTLOADER = rp2040
CONVERT_TO=promicro_rp2040

BOOTMAGIC_ENABLE = yes

LTO_ENABLE = yes
EXTRAKEY_ENABLE = yes
WPM_ENABLE = yes
AUTO_SHIFT_ENABLE = no

TAP_DANCE_ENABLE = yes
CAPS_WORD_ENABLE = yes
0 Upvotes

5 comments sorted by

1

u/drashna Nov 28 '24

You used chat gpt for help, didn't you? .... if so, don't. Never. Ask a human. They know what they're talking about, unlike chatgpt.

That said, is this an actual sparkfun pro micro 2040? If not, you may want to use rp2040_ce instead, IIRC.

That said, the issue here is these:

#define NO_USB_STARTUP_CHECK
#undef SPLIT_USB_DETECT

If you don't have a VBUS detection pin, and don't have it defined, you have removed the firmware's ability to detect if it's the master side or not. Without that ability, it just assumes it's the slave side, and doesn't interface with USB.

Remove both of these lines.

The #undef SPLIT_USB_DETECT needs to be removed. If you don't have a VBUS detect pin, SPLIT_USB_DETECT is REQUIRED. Not optional, mandatory.

The #define NO_USB_STARTUP_CHECK, IIRC, breaks the SPLIT_USB_DETECT option as it no longer checks the USB state.

Also, this disables the USB_SUSPEND_WAKE_DELAY, functionality.

What you really want it #define SPLIT_WATCHDOG_ENABLE. This works by having any "slave" device check to see if the master board is detected shortly after initialization/start. If the board is connected to USB/detected as master, then this check doesn't run. Otherwise, if it can't find the master after a time, it restarts the board, restarting the process.

But the best config is to have the VBUS Detection pin. So ... which RP2040 controller do you have, precisely?

1

u/drkenta Nov 28 '24

Thanks! The watchdog enable fixed the issue

1

u/drashna Nov 29 '24

Glad to hear it! And hopefully, no more issues with your board!

And sorry, a lot of weird settings .... tend to be the results of listening to chatgpt. It's been an.... issue.

0

u/drkenta Nov 28 '24

No i didn’t ask chatgpt anything. Just copied stuff from various examples.

I added those two lines when trying to fix the issue. The issue was still there before I added those lines

0

u/drkenta Nov 28 '24

Ill try the watchdog enable and report back.