diff --git a/bootloaders/riotboot_dfu/Makefile b/bootloaders/riotboot_dfu/Makefile index 86995d3119..4a943449c9 100644 --- a/bootloaders/riotboot_dfu/Makefile +++ b/bootloaders/riotboot_dfu/Makefile @@ -5,7 +5,8 @@ APPLICATION = riotboot_dfu USEMODULE += riotboot_usb_dfu # Use xtimer for scheduled reboot -USEMODULE += xtimer +USEMODULE += ztimer +USEMODULE += ztimer_auto_init # USB device vendor and product ID # pid.codes test VID/PID, not globally unique diff --git a/bootloaders/riotboot_dfu/main.c b/bootloaders/riotboot_dfu/main.c index ebf876042b..91606817b5 100644 --- a/bootloaders/riotboot_dfu/main.c +++ b/bootloaders/riotboot_dfu/main.c @@ -26,6 +26,7 @@ #include "panic.h" #include "riotboot/slot.h" #include "riotboot/usb_dfu.h" +#include "ztimer.h" #include "bootloader_selection.h" @@ -70,6 +71,9 @@ void kernel_init(void) riotboot_slot_jump(slot); } + /* Init ztimer before starting DFU mode */ + ztimer_init(); + /* Nothing to boot, stay in DFU mode to flash a slot */ riotboot_usb_dfu_init(1); }