Skip to content

Exit bootloader and jump to app when USB is disconnected#390

Open
jesuslg123 wants to merge 3 commits intoadafruit:masterfrom
jesuslg123:auto-reboot-on-usb-disconnected
Open

Exit bootloader and jump to app when USB is disconnected#390
jesuslg123 wants to merge 3 commits intoadafruit:masterfrom
jesuslg123:auto-reboot-on-usb-disconnected

Conversation

@jesuslg123
Copy link

@jesuslg123 jesuslg123 commented Mar 8, 2026

Description of Change

Summary

This PR updates bootloader startup behavior so it automatically jumps to the application in specific USB-related cases, provided the application is valid.

New behavior

The bootloader now jumps to the app when:

  • USB is not enumerated within 3 seconds during boot.
    • If no USB host enumerates the device in that window, the bootloader times out and starts the app.
  • USB was enumerated during startup, but is later physically disconnected.
    • In that case, the bootloader exits startup DFU and starts the app.

In both cases, the jump only happens if a valid application is present.

Behavior that does not change

This auto-jump logic does not apply to DFU flows that are intended to keep the device in DFU mode, including:

  • Double-reset DFU
  • DFU button entry, or DFU+OTA button entry
  • OTA/BLE DFU
  • Any path that calls bootloader_dfu_start(..., 0, false)

Rationale

This makes USB-startup DFU less sticky for normal boot scenarios: if a host never enumerates the device, or if the USB cable is disconnected after enumeration, the device can continue into the main application automatically instead of remaining in the bootloader unnecessarily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant