Skip to content

3 second timeout is too short #394

Description

@joelspadin

Operating System

Windows 11

INFO_UF2.TXT

UF2 Bootloader 0.10.0-18-g9d3addd-dirty
Model: Marten Numpad
Board-ID: nRF52840-Marten-Numpad
Date: Mar 21 2026
SoftDevice: not found

What happened ?

For some reason, my Windows PC now takes a random amount of time between 3 and 7 seconds for USB to enumerate after resetting into bootloader by setting GPREGRET to DFU_MAGIC_UF2_RESET. This means that the 3 second timeout at

bootloader_dfu_start(_ota_dfu, 3000, true);
almost always expires, and it restarts right back into the application code. I have to double tap the reset button (or increase the timeout to 10 seconds) to reliably get the bootloader to stay in DFU mode.

I suspect this is due to a Windows change rather than an issue in the bootloader, as I did not have this issue the last time I updated firmware on this device a few months ago, and I had not made any changes to the bootloader. I have a fork of the repo with a custom board definition, and it was previously based on commit 6a9a6a3, but updating to 48a149f did not change anything.

If this issue isn't specific to my PC and is something that's happening more generally on Windows PCs, then this timeout likely needs to be increased or made configurable somehow.

How to reproduce ?

  1. Connect the device to the PC with a USB-C cable.
  2. Flash the bootloader and ZMK firmware with a keymap containing the &bootloader behavior.
  3. Press the &bootloader key, which resets the device with GPREGRET = 0x57

Expected behavior: the device enters DFU mode and stays there so I can flash it.

Actual behavior: the status LED flashes quickly for 3 seconds, then it restarts back into application code.

Debug Log

No response

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions