]>
git.gir.st - tmk_keyboard.git/blob - tmk_core/common/chibios/bootloader.c
1 #include "bootloader.h"
6 #ifdef STM32_BOOTLOADER_ADDRESS
10 /* This code should be checked whether it runs correctly on platforms */
11 #define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0))
12 extern uint32_t __ram0_end__
;
14 void bootloader_jump(void) {
15 *((unsigned long *)(SYMVAL(__ram0_end__
) - 4)) = 0xDEADBEEF; // set magic flag => reset handler will jump into boot loader
19 #else /* defined(STM32F0XX) */
20 #error Check that the bootloader code works on your platform and add it to bootloader.c!
21 #endif /* defined(STM32F0XX) */
23 #elif defined(KL2x) || defined(K20x) /* STM32_BOOTLOADER_ADDRESS */
26 void bootloader_jump(void) {
27 chThdSleepMilliseconds(100);
31 #else /* neither STM32 nor KINETIS */
32 void bootloader_jump(void) {}