#Split_watchdog_enable does not restart device

30 messages · Page 1 of 1 (latest)

tranquil smelt
#

I want to use the SPLIT_WATCHDOG_ENABLE option because I do not want to restart the Keyboard half connected to pc manually after booting.
In my understanding this option should restart both halves (independently) if they do not detect usb activity.
Instead i now have to manually restart both halves before they detect the pc and start communicating.
I determined this by displaying current layer on a display (one on each side).
The master display changes after manually restarting master half. After, the slave display only changes after manually restarting slave.

Split keyboard with rp2040 in pro micro format. Using the following options (that are somehow relevant to communication or usb):
config.h:

#define SPLIT_USB_DETECT
#define SPLIT_WATCHDOG_ENABLE // I added this
#define SPLIT_TRANSPORT_MIRROR
#define EE_HANDS

#define SPECULATIVE_HOLD
#define HOLD_ON_OTHER_KEY_PRESS

#define LAYER_STATE_32BIT

#define LEADER_KEY_STRICT_KEY_PROCESSING
#define LEADER_PER_KEY_TIMING
#define LEADER_TIMEOUT 500

#define UNICODE_SELECTED_MODES UNICODE_MODE_LINUX, UNICODE_MODE_WINDOWS

rules.mk:

SERIAL_DRIVER = vendor
OS_DETECTION_ENABLE = yes

ENCODER_MAP_ENABLE = yes
WS2812_DRIVER = vendor
QUANTUM_PAINTER_ENABLE = yes
QUANTUM_PAINTER_DRIVERS += sh1106_i2c
TAP_CODE_DELAY = 0
KEY_OVERRIDE_ENABLE = yes
UNICODE_ENABLE = yes
LEADER_ENABLE = yes

keyboard.json:

    "split": {
        "enabled": true,
        "serial": {
            "driver": "vendor",
            "pin": "GP1"
        },
        "transport": {
            "protocol": "serial",
            "sync": {
                "oled": true,
                "matrix_state": true,
                "layer_state": true
            }

        }
    },
    "features": {
        "bootmagic": true,
        "command": false,
        "console": false,
        "extrakey": true,
        "mousekey": true,
        "nkro": true,
        "rgb_matrix": true,
        "oled": false
    },

Thank you for your input.

olive lantern
#

that's not exactly how split watchdog works though.

#

specifically, if the side is detected as slave, it checks for a signal from master (using split data syncing, and is initiated on the master side). If it doesn't get that signal from within the timeout, it will reboot the controller.

#

this means that the master side never reboots (because if it's the master side, the reset code path isn't triggered, just the "send ping to slave side" code path)

#

and if the slave side has connected to the master side, it won't reboot, unless it's power cycled

#

if anything, it sounds like you're having an issue with split communication, more than anything else

#

or otherwise the usb is being woken .... weirdly

#

so do you run into issues if just the one half is connected to USB?

#

if you are, that would need to be resolved before you do anything else.

#

and you don't need split usb detect defined, if you don't have USB_VBUS_PIN defined.

#

if you're using a converter, a number of these do support VBUS pin automatically, and you definitely shouldn't define split usb detect, in this case (eg, anything that uses rp2040_ce)

tranquil smelt
tranquil smelt
tranquil smelt
tranquil smelt
earnest condor
#

The intended way for the split watchdog to work is:

  • While the computer only supplies power, but does not actually communicate over USB, both halves would start up as slave (after waiting for SPLIT_USB_TIMEOUT).
  • When both halves had been initialized as slaves, they would wait for a ping from the master half, which won't actually happen; when the split watchdog timeout expires without getting that ping, both halves will reboot and redo the USB connectivity detection again. This reboot loop should continue while the power is present without any actual USB communication.
  • Eventually the computer should start USB enumeration; at this time the half which actually has USB connected should notice it and initialize as master. When this happens, the split watchdog code won't reboot the master half again (if the USB data connectivity would be lost after this point while keeping the power, this would be interpreted as USB suspend).
  • The half which initialized as master should now attempt to communicate with the slave half; the actual slave half would now detect those attempts and stop the split watchdog, so it won't reboot anymore.
tranquil smelt
#

I added code to display time since startup. Shortly before it reaches SPLIT_WATCHDOG_TIMEOUT it freezes and no longer changes.

#

Disabling usb_detect (and watchdog) in config.h has no observable change (over just usb_detect).

olive lantern
#

what's the (full) output of qmk doctor?

tranquil smelt
#
Ψ QMK Doctor is checking your environment.
Ψ Python version: 3.13.9
Ψ CLI version: 1.1.8
Ψ QMK home: /home/simon/qmk_firmware
Ψ Detected Linux (NixOS 25.11 (Xantusia)).
Ψ Testing userspace candidate: /home/simon/qmk_userspace -- Valid `qmk.json`
Ψ QMK userspace: /home/simon/qmk_userspace
Ψ Userspace enabled: True
Ψ Git branch: master
Ψ Repo version: 0.31.3
Ψ - Latest master: 2025-11-22 11:57:16 +0100 (cdbc7cca03) -- Setup_QP: disable QP in main loop when using it in c1_main
Ψ - Latest upstream/master: 2026-01-01 23:19:14 +1100 (99b5b9ab7f) -- [CI] Regenerate Files (#25920)
Ψ - Latest upstream/develop: None
Ψ - Common ancestor with upstream/master: 2025-12-21 04:07:40 +0000 (dba60e2e65) -- Re-fix building of XAP keymaps on master/develop (#25892)
Ψ - Common ancestor with upstream/develop: None
☒ Can't find dos2unix in your path.
☒ dos2unix may need to be installed, or its location added to your path.
Ψ Found arm-none-eabi-gcc version 14.3.1
Ψ Successfully compiled using arm-none-eabi-gcc
Ψ Successfully tested arm-none-eabi-binutils using arm-none-eabi-size
Ψ Found avr-gcc version 14.3.0
Ψ Successfully compiled using avr-gcc
Ψ Successfully tested avr-binutils using avr-size
Ψ Found avrdude version t
Ψ Found dfu-programmer version 0.7.2
Ψ Found dfu-util version 0.11
Ψ Found diff version 3.12
⚠ Unknown version for dos2unix
Ψ Found git version 2.51.2
Ψ Found make version 4.4.1
Ψ Submodules are up to date.
Ψ Submodule status:
Ψ - lib/chibios: 2025-05-15 08:25:11 +0000 --  (8bd61b8043)
Ψ - lib/chibios-contrib: 2025-10-03 18:22:15 +0200 --  (8d863d9e)
Ψ - lib/googletest: 2021-06-11 06:37:43 -0700 --  (e2239ee6)
Ψ - lib/lufa: 2022-08-26 12:09:55 +1000 --  (549b97320)
Ψ - lib/vusb: 2022-06-13 09:18:17 +1000 --  (819dbc1)
Ψ - lib/printf: 2022-06-29 23:59:58 +0300 --  (c2e3b4e)
Ψ - lib/pico-sdk: 2025-04-20 21:24:29 +1000 --  (d0c5cac)
Ψ - lib/lvgl: 2022-04-11 04:44:53 -0600 --  (e19410f8)
Ψ Major problems detected, please fix these problems before proceeding.
#

git diff master

diff --git a/quantum/main.c b/quantum/main.c
index 3159c55850..8f8424fd10 100644
--- a/quantum/main.c
+++ b/quantum/main.c
@@ -60,7 +60,7 @@ int main(void) {
         console_task();
 #endif
 
-#ifdef QUANTUM_PAINTER_ENABLE
+#if defined(QUANTUM_PAINTER_ENABLE) && !defined(SETUP_QP_DUAL_CORE)
         // Run Quantum Painter task
         void qp_internal_task(void);
         qp_internal_task();

Note that SETUP_QP_DUAL_CORE is not defined

tranquil smelt
#

After installing dos2unix:

Ψ QMK Doctor is checking your environment.
Ψ Python version: 3.13.9
Ψ CLI version: 1.1.8
Ψ QMK home: /home/simon/qmk_firmware
Ψ Detected Linux (NixOS 25.11 (Xantusia)).
Ψ Testing userspace candidate: /home/simon/qmk_userspace -- Valid `qmk.json`
Ψ QMK userspace: /home/simon/qmk_userspace
Ψ Userspace enabled: True
Ψ Git branch: master
Ψ Repo version: 0.31.3
Ψ - Latest master: 2025-11-22 11:57:16 +0100 (cdbc7cca03) -- Setup_QP: disable QP in main loop when using it in c1_main
Ψ - Latest upstream/master: 2026-01-03 06:55:17 -0700 (ddeaa26fef) -- Add `.env`, `.envrc` to gitignore (#25904)
Ψ - Latest upstream/develop: None
Ψ - Common ancestor with upstream/master: 2025-12-21 04:07:40 +0000 (dba60e2e65) -- Re-fix building of XAP keymaps on master/develop (#25892)
Ψ - Common ancestor with upstream/develop: None
Ψ All dependencies are installed.
Ψ Found arm-none-eabi-gcc version 14.3.1
Ψ Successfully compiled using arm-none-eabi-gcc
Ψ Successfully tested arm-none-eabi-binutils using arm-none-eabi-size
Ψ Found avr-gcc version 14.3.0
Ψ Successfully compiled using avr-gcc
Ψ Successfully tested avr-binutils using avr-size
Ψ Found avrdude version t
Ψ Found dfu-programmer version 0.7.2
Ψ Found dfu-util version 0.11
Ψ Found diff version 3.12
Ψ Found dos2unix version 7.5.2
Ψ Found git version 2.51.2
Ψ Found make version 4.4.1
Ψ Submodules are up to date.
Ψ Submodule status:
Ψ - lib/chibios: 2025-05-15 08:25:11 +0000 --  (8bd61b8043)
Ψ - lib/chibios-contrib: 2025-10-03 18:22:15 +0200 --  (8d863d9e)
Ψ - lib/googletest: 2021-06-11 06:37:43 -0700 --  (e2239ee6)
Ψ - lib/lufa: 2022-08-26 12:09:55 +1000 --  (549b97320)
Ψ - lib/vusb: 2022-06-13 09:18:17 +1000 --  (819dbc1)
Ψ - lib/printf: 2022-06-29 23:59:58 +0300 --  (c2e3b4e)
Ψ - lib/pico-sdk: 2025-04-20 21:24:29 +1000 --  (d0c5cac)
Ψ - lib/lvgl: 2022-04-11 04:44:53 -0600 --  (e19410f8)
Ψ QMK is ready to go
tranquil smelt
#

Reflashing with dos2unix, usb detect & watchdog does not change behavior.

olive lantern
#

dos2unix is a code line ending tool, so it wouldn't do anything

#

and it looks like your repo is up to date, at least

#

by chance does adding #define USB_SUSPEND_WAKEUP_DELAY 2000 help?

tranquil smelt
#

Only one half (disconnected other) with

#define SPLIT_USB_DETECT
#define SPLIT_USB_TIMEOUT 5000
#define SPLIT_WATCHDOG_ENABLE
#define SPLIT_WATCHDOG_TIMEOUT 10000
#define USB_SUSPEND_WAKEUP_DELAY 2000

does start as slave and not restart after WATCHDOG_TIMEOUT.

olive lantern
#

does the master side start correctly?

tranquil smelt
#

I was testing with only the master side