Fixup STM32-DFU (#21447)
This commit is contained in:
parent
2031827852
commit
2976bd627e
|
@ -107,6 +107,12 @@ void enter_bootloader_mode_if_requested(void) {
|
||||||
if (bootloader_marker_active()) {
|
if (bootloader_marker_active()) {
|
||||||
bootloader_marker_disable();
|
bootloader_marker_disable();
|
||||||
|
|
||||||
|
struct system_memory_vector_t {
|
||||||
|
uint32_t stack_top;
|
||||||
|
void (*entrypoint)(void);
|
||||||
|
};
|
||||||
|
const struct system_memory_vector_t *bootloader = (const struct system_memory_vector_t *)(STM32_BOOTLOADER_ADDRESS);
|
||||||
|
|
||||||
__disable_irq();
|
__disable_irq();
|
||||||
|
|
||||||
# if defined(QMK_MCU_ARCH_CORTEX_M7)
|
# if defined(QMK_MCU_ARCH_CORTEX_M7)
|
||||||
|
@ -128,16 +134,11 @@ void enter_bootloader_mode_if_requested(void) {
|
||||||
NVIC->ICPR[i] = 0xFFFFFFFF;
|
NVIC->ICPR[i] = 0xFFFFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__set_CONTROL(0);
|
||||||
|
__set_MSP(bootloader->stack_top);
|
||||||
__enable_irq();
|
__enable_irq();
|
||||||
|
|
||||||
struct system_memory_vector_t {
|
|
||||||
uint32_t stack_top;
|
|
||||||
void (*entrypoint)(void);
|
|
||||||
};
|
|
||||||
const struct system_memory_vector_t *bootloader = (const struct system_memory_vector_t *)(STM32_BOOTLOADER_ADDRESS);
|
|
||||||
|
|
||||||
// Jump to bootloader
|
// Jump to bootloader
|
||||||
__set_MSP(bootloader->stack_top);
|
|
||||||
bootloader->entrypoint();
|
bootloader->entrypoint();
|
||||||
while (true) {
|
while (true) {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue