File tree 1 file changed +11
-0
lines changed
libraries/SrcWrapper/src/stm32 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,17 @@ WEAK uint32_t bootloaderAddress() {
78
78
/* Jump to system memory boot from user application */
79
79
WEAK void jumpToBootloaderIfRequested (void )
80
80
{
81
+ // If we are not at the start of flash, assume that a custom
82
+ // bootloader is in front of us, and there is no need to jump to it
83
+ // (since it will run before we can run anyway). If such a bootloader
84
+ // exists, the BootIntoBootloaderAfterReset variable will likely be
85
+ // corrupted anyway.
86
+ // TODO: Might be better to use a specific macro to control this,
87
+ // rather than check VECT_TAB_OFFSET
88
+ #if defined(VECT_TAB_OFFSET ) && (VECT_TAB_OFFSET > 0 )
89
+ return ;
90
+ #endif
91
+
81
92
// Boot into bootloader if BootIntoBootloaderAfterReset is set.
82
93
// Note that BootIntoBootloaderAfterReset is a noinit variable, so it
83
94
// s not automatically initialized on startup (so it can keep its
You can’t perform that action at this time.
0 commit comments