Skip to content

Check USB host connection and fall back to OTA DFU if there is none #40

Description

@avg-I

Is your feature request related to a problem? Please describe.
This is mostly an issue for boards like Pro Micro that lack physical buttons to control DFU mode.
On that board there seem to be only two ways to activate OTA:

  • there is no valid application at all;
  • an application explicitly requests OTA DFU before doing a reset.

Describe the solution you'd like
The boot loader could check if the board is connected to a USB host at all.
If not, then it does not make sense to expect USB serial or UF2 DFU.
E.g., if the board is powered via a battery or a dumb charger.

I think that such an enhancement would make sense even for boards with physical buttons.

Describe alternatives you've considered

Always having to patch application, so that the right DFU mode is initiated.

Additional context

It seems that something like app_usbd_core_state_get or raw NRF_USBD->USBADDR > 0 can be used as a check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions