diff --git a/core/embed/bootloader/main.c b/core/embed/bootloader/main.c index 4596373540..d54e0ba838 100644 --- a/core/embed/bootloader/main.c +++ b/core/embed/bootloader/main.c @@ -165,7 +165,6 @@ static usb_result_t bootloader_usb_loop(const vendor_header *const vhdr, if (INPUT_CANCEL == response) { send_user_abort(USB_IFACE_NUM, "Wipe cancelled"); hal_delay(100); - usb_stop(); usb_deinit(); return RETURN_TO_MENU; } @@ -174,13 +173,11 @@ static usb_result_t bootloader_usb_loop(const vendor_header *const vhdr, if (r < 0) { // error screen_wipe_fail(); hal_delay(100); - usb_stop(); usb_deinit(); return SHUTDOWN; } else { // success screen_wipe_success(); hal_delay(100); - usb_stop(); usb_deinit(); return SHUTDOWN; } @@ -197,12 +194,10 @@ static usb_result_t bootloader_usb_loop(const vendor_header *const vhdr, } else { ui_screen_fail(); } - usb_stop(); usb_deinit(); return SHUTDOWN; } else if (r == UPLOAD_ERR_USER_ABORT) { hal_delay(100); - usb_stop(); usb_deinit(); return RETURN_TO_MENU; } else if (r == 0) { // last chunk received @@ -214,7 +209,6 @@ static usb_result_t bootloader_usb_loop(const vendor_header *const vhdr, hal_delay(1000); ui_screen_done(1, secfalse); hal_delay(1000); - usb_stop(); usb_deinit(); return CONTINUE_TO_FIRMWARE; } @@ -228,14 +222,12 @@ static usb_result_t bootloader_usb_loop(const vendor_header *const vhdr, if (INPUT_CANCEL == response) { send_user_abort(USB_IFACE_NUM, "Bootloader unlock cancelled"); hal_delay(100); - usb_stop(); usb_deinit(); return RETURN_TO_MENU; } process_msg_UnlockBootloader(USB_IFACE_NUM, msg_size, buf); screen_unlock_bootloader_success(); hal_delay(100); - usb_stop(); usb_deinit(); return SHUTDOWN; break; diff --git a/core/embed/bootloader_ci/main.c b/core/embed/bootloader_ci/main.c index f9dfe64a24..33c6b70038 100644 --- a/core/embed/bootloader_ci/main.c +++ b/core/embed/bootloader_ci/main.c @@ -117,12 +117,10 @@ static secbool bootloader_usb_loop(const vendor_header *const vhdr, r = process_msg_WipeDevice(USB_IFACE_NUM, msg_size, buf); if (r < 0) { // error ui_screen_fail(); - usb_stop(); usb_deinit(); return secfalse; // shutdown } else { // success ui_screen_done(0, sectrue); - usb_stop(); usb_deinit(); return secfalse; // shutdown } @@ -134,7 +132,6 @@ static secbool bootloader_usb_loop(const vendor_header *const vhdr, r = process_msg_FirmwareUpload(USB_IFACE_NUM, msg_size, buf); if (r < 0 && r != UPLOAD_ERR_USER_ABORT) { // error, but not user abort ui_screen_fail(); - usb_stop(); usb_deinit(); return secfalse; // shutdown } else if (r == 0) { // last chunk received @@ -146,7 +143,6 @@ static secbool bootloader_usb_loop(const vendor_header *const vhdr, hal_delay(1000); ui_screen_done(1, secfalse); hal_delay(1000); - usb_stop(); usb_deinit(); return sectrue; // jump to firmware } diff --git a/core/embed/extmod/modtrezorio/modtrezorio-usb.h b/core/embed/extmod/modtrezorio/modtrezorio-usb.h index 3afcc7846d..39e4d9e8f0 100644 --- a/core/embed/extmod/modtrezorio/modtrezorio-usb.h +++ b/core/embed/extmod/modtrezorio/modtrezorio-usb.h @@ -251,7 +251,6 @@ STATIC mp_obj_t mod_trezorio_USB_close(mp_obj_t self) { if (o->state != USB_OPENED) { mp_raise_msg(&mp_type_RuntimeError, "not initialized"); } - usb_stop(); usb_deinit(); mp_obj_list_set_len(MP_OBJ_FROM_PTR(&o->ifaces), 0); mp_seq_clear(o->ifaces.items, 0, o->ifaces.alloc, sizeof(*o->ifaces.items)); @@ -271,7 +270,6 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_trezorio_USB_close_obj, STATIC mp_obj_t mod_trezorio_USB___del__(mp_obj_t self) { mp_obj_USB_t *o = MP_OBJ_TO_PTR(self); if (o->state != USB_CLOSED) { - usb_stop(); usb_deinit(); o->state = USB_CLOSED; }