您最多选择25个主题
主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。
12345678910111213141516 |
- #include "bootloader.h"
-
- #include "ch.h"
-
- #ifdef STM32_BOOTLOADER_ADDRESS
- #define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0))
- extern uint32_t __ram0_end__;
-
- void bootloader_jump(void) {
- *((unsigned long *)(SYMVAL(__ram0_end__) - 4)) = 0xDEADBEEF; // set magic flag => reset handler will jump into boot loader
- NVIC_SystemReset();
- }
- #else /* STM32_BOOTLOADER_ADDRESS */
- void bootloader_jump(void) {}
- #endif /* STM32_BOOTLOADER_ADDRESS */
|