Skip to content

Central side does not wake from sleep when ZMK Studio is enabled (Zephyr 4.1) #3195

@p0ns

Description

@p0ns

Description

After upgrading to Zephyr 4.1 (commit c06fa48c), the central half of a split keyboard does not wake from deep sleep (CONFIG_ZMK_SLEEP=y) when CONFIG_ZMK_STUDIO=y is enabled. The peripheral side wakes normally.

Disabling ZMK Studio resolves the issue - the central wakes from sleep as expected.

Environment

  • ZMK Version: main branch (post-Zephyr 4.1 upgrade)
  • Board: nice_nano (nRF52840)
  • Shield: Corne with nice_view display
  • Relevant Config:
    CONFIG_ZMK_SLEEP=y
    CONFIG_ZMK_DISPLAY=y
    CONFIG_ZMK_STUDIO=y
    

Steps to Reproduce

  1. Build firmware for a split keyboard central with CONFIG_ZMK_SLEEP=y and CONFIG_ZMK_STUDIO=y
  2. Flash to the central half (e.g., left side)
  3. Wait for the keyboard to enter deep sleep (default 15 min idle timeout)
  4. Press a key on the central side
  5. Expected: Keyboard wakes up
  6. Actual: Keyboard does not wake; requires reset or power cycle

Workaround

Disable ZMK Studio:

# CONFIG_ZMK_STUDIO=y

Analysis

The issue appeared with the Zephyr 4.1 upgrade. Key changes in that commit:

  1. PM API change in app/src/pm.c - Removed pm_device_state_is_locked() check (function was removed in Zephyr 3.7):

    // Before:
    if (!device_is_ready(dev) || pm_device_is_busy(dev) || pm_device_state_is_locked(dev) ||
        pm_device_wakeup_is_enabled(dev) || pm_device_runtime_is_enabled(dev)) {
    
    // After:
    if (!device_is_ready(dev) || pm_device_is_busy(dev) || pm_device_wakeup_is_enabled(dev) ||
        pm_device_runtime_is_enabled(dev)) {
  2. Conditional compilation change - #if !defined(CONFIG_PM_DEVICE_RUNTIME_EXCLUSIVE) changed to #if defined(CONFIG_PM_DEVICE_SYSTEM_MANAGED)

ZMK Studio enables USB CDC ACM, UART RPC transport, and additional threads. One of these components may be:

  • Not properly suspending before sys_poweroff()
  • Holding GPIO pins in a state that blocks SENSE-based wake detection
  • Missing wakeup-source configuration

The peripheral (without Studio features) wakes correctly, confirming the issue is specific to Studio-enabled central builds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions