diff --git a/startup_stm32f042x6.s b/startup_stm32f042x6.s --- a/startup_stm32f042x6.s +++ b/startup_stm32f042x6.s @@ -84,6 +84,7 @@ Reset_Handler: /* Boot into bootloader */ Reboot_Loader: + b Reboot_Loader LDR R0, =0x40021018 // RCC_APB2ENR (+0x18) LDR R1, =0x00000001 // ENABLE SYSCFG CLOCK STR R1, [R0, #0] @@ -91,12 +92,13 @@ Reboot_Loader: LDR R1, =0x00000001 // MAP ROM AT ZERO STR R1, [R0, #0] // LDR R0, =0x1FFFEC00 ; ROM BASE (STM32F03x) - LDR R0, =0x1FFFC400 // ROM BASE (STM32F04x) + LDR R0, =0x1FFFC800 // ROM BASE (STM32F04x) // LDR R0, =0x1FFFEC00 ; ROM BASE (STM32F05x) // LDR R0, =0x1FFFC800 ; ROM BASE (STM32F07x) // LDR R0, =0x1FFFD800 ; ROM BASE (STM32F09x) LDR R1, [R0, #0] // SP @ +0 MOV SP, R1 + LDR R0, [R0, #4] // PC @ +4 BX R0