diff --git a/embed/trezorhal/common.c b/embed/trezorhal/common.c index 897f0fb09..82f0d02ed 100644 --- a/embed/trezorhal/common.c +++ b/embed/trezorhal/common.c @@ -4,8 +4,6 @@ #include "display.h" #include "rng.h" -void shutdown(void); - void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg, const char *file, int line, const char *func) { display_orientation(0); display_backlight(255); @@ -28,7 +26,6 @@ void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg, #define STR(s) #s display_printf("rev : %s\n", XSTR(GITREV)); #endif - clear_otg_hs_memory(); shutdown(); for (;;); } diff --git a/embed/trezorhal/common.h b/embed/trezorhal/common.h index eee0ade4d..a8158a804 100644 --- a/embed/trezorhal/common.h +++ b/embed/trezorhal/common.h @@ -22,6 +22,8 @@ void jump_to(uint32_t address); void hal_delay(uint32_t ms); +void shutdown(void); + extern uint32_t __stack_chk_guard; #endif diff --git a/embed/trezorhal/util.s b/embed/trezorhal/util.s index 6d75ce6c2..3a59f8d61 100644 --- a/embed/trezorhal/util.s +++ b/embed/trezorhal/util.s @@ -66,6 +66,7 @@ jump_to: .type shutdown, STT_FUNC shutdown: cpsid f + bl clear_otg_hs_memory ldr r0, =ccmram_start ldr r1, =ccmram_end ldr r2, =0