From 587b5e8eb867467b7fac1dae46e0f53c8619c8f1 Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Fri, 28 Feb 2025 11:27:03 +0100 Subject: [PATCH] fix(core): fix jump to old bootloader Initialize systick before jump, as the old bootloaders may not initialize systick on start and rely on systick running from boardloader or firmware. Only relevant for F4, otherwise we are jumping through reset. [no changelog] --- core/embed/sys/startup/stm32/bootutils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/embed/sys/startup/stm32/bootutils.c b/core/embed/sys/startup/stm32/bootutils.c index aeae943ac9..1cedd54ea4 100644 --- a/core/embed/sys/startup/stm32/bootutils.c +++ b/core/embed/sys/startup/stm32/bootutils.c @@ -168,6 +168,10 @@ static void reboot_with_args_phase_2(uint32_t arg1, uint32_t arg2) { if (command == BOOT_COMMAND_NONE) { NVIC_SystemReset(); } else { +#ifndef FIXED_HW_DEINIT + SysTick_Config(HAL_RCC_GetSysClockFreq() / 1000U); + NVIC_SetPriority(SysTick_IRQn, 0); +#endif jump_to_vectbl(BOOTLOADER_START + IMAGE_HEADER_SIZE, command); } #else