RIOT-OS / RIOT

RIOT - The friendly OS for IoT
https://riot-os.org
GNU Lesser General Public License v2.1
4.9k stars 1.98k forks source link

usbus/dfu: cannot detach device to reboot into bootloader #20474

Closed dylad closed 6 months ago

dylad commented 6 months ago

Description

When dfu is in used, one can use dfu-util -e from a shell when the application is running to perform a reset into bootloader. (if USEMODULE=usbus_dfu) is present. However, in current master, the operation fails. It seems this regression was introduced by #17090.

Steps to reproduce the issue

Flash riotboot_dfu bootloader app: make BOARD=same54-xpro -C bootloaders/riotboot_dfu flash Flash an application on riotboot/slot0: FEATURES_REQUIRED=riotboot PROGRAMMER=dfu-util USEMODULE=usbus_dfu make -j8 BOARD=same54-xpro -C tests/sys/shell riotboot/flash-slot0 Try to flash another application: DFU_USB_ID=1209:7d00 FEATURES_REQUIRED=riotboot PROGRAMMER=dfu-util USEMODULE=usbus_dfu make -j8 BOARD=same54-xpro -C tests/leds riotboot/flash-slot1

Expected results

The last application should be flashed properly and running afterwards.

Actual results

Flashing fails because device doesn't reboot into bootloader.

dylad commented 6 months ago

I think I've identified the issue. I'll prepare a patch in the following days.