Skip to content

Commit cb8eaad

Browse files
committed
fix vibl
1 parent 4c5373c commit cb8eaad

File tree

2 files changed

+12
-9
lines changed
  • platforms/chibios

2 files changed

+12
-9
lines changed

platforms/chibios/boards/STM32_F103_vibl/board/board.c

-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "vial.h"
2121
#endif
2222

23-
#define RTC_BOOTLOADER_FLAG 0x7662 /* Flag whether to jump into bootloader, "vb" */
2423
#define RTC_INSECURE_FLAG 0x4953 /* Flag to indicate qmk that we want to boot into insecure mode, "IS" */
2524

2625
/**
@@ -62,9 +61,3 @@ void boardInit(void) {
6261
#endif
6362
BKP->DR10 = 0;
6463
}
65-
66-
void bootloader_jump(void) {
67-
//Set backup register DR10 to enter bootloader on reset
68-
BKP->DR10 = RTC_BOOTLOADER_FLAG;
69-
NVIC_SystemReset();
70-
}

platforms/chibios/bootloaders/vibl.c

+12-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@
1616

1717
#include "bootloader.h"
1818

19-
__attribute__((weak)) void bootloader_jump(void) {}
19+
#include <ch.h>
2020

21-
__attribute__((weak)) void enter_bootloader_mode_if_requested(void) {}
21+
#define RTC_BOOTLOADER_FLAG 0x7662 /* Flag whether to jump into bootloader, "vb" */
22+
23+
__attribute__((weak)) void bootloader_jump(void) {
24+
BKP->DR10 = RTC_BOOTLOADER_FLAG;
25+
NVIC_SystemReset();
26+
}
27+
28+
__attribute__((weak)) void mcu_reset(void) {
29+
BKP->DR10 = 0;
30+
NVIC_SystemReset();
31+
}

0 commit comments

Comments
 (0)