Merge pull request #1113 from blckmn/dfu_mode
DFU mode via CLI for F1 and F3
This commit is contained in:
commit
534b37bc1a
|
@ -114,4 +114,17 @@ void systemInit(void)
|
||||||
|
|
||||||
void checkForBootLoaderRequest(void)
|
void checkForBootLoaderRequest(void)
|
||||||
{
|
{
|
||||||
|
void(*bootJump)(void);
|
||||||
|
|
||||||
|
if (*((uint32_t *)0x20004FF0) == 0xDEADBEEF) {
|
||||||
|
|
||||||
|
*((uint32_t *)0x20004FF0) = 0x0;
|
||||||
|
|
||||||
|
__enable_irq();
|
||||||
|
__set_MSP(*((uint32_t *)0x1FFFF000));
|
||||||
|
|
||||||
|
bootJump = (void(*)(void))(*((uint32_t *) 0x1FFFF004));
|
||||||
|
bootJump();
|
||||||
|
while (1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,4 +107,17 @@ void systemInit(void)
|
||||||
|
|
||||||
void checkForBootLoaderRequest(void)
|
void checkForBootLoaderRequest(void)
|
||||||
{
|
{
|
||||||
|
void(*bootJump)(void);
|
||||||
|
|
||||||
|
if (*((uint32_t *)0x20009FFC) == 0xDEADBEEF) {
|
||||||
|
|
||||||
|
*((uint32_t *)0x20009FFC) = 0x0;
|
||||||
|
|
||||||
|
__enable_irq();
|
||||||
|
__set_MSP(*((uint32_t *)0x1FFFD800));
|
||||||
|
|
||||||
|
bootJump = (void(*)(void))(*((uint32_t *) 0x1FFFD804));
|
||||||
|
bootJump();
|
||||||
|
while (1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,9 +196,9 @@ void checkForBootLoaderRequest(void)
|
||||||
*((uint32_t *)0x2001FFFC) = 0x0;
|
*((uint32_t *)0x2001FFFC) = 0x0;
|
||||||
|
|
||||||
__enable_irq();
|
__enable_irq();
|
||||||
__set_MSP(0x20001000);
|
__set_MSP(*((uint32_t *)0x1FFF0000));
|
||||||
|
|
||||||
bootJump = (void(*)(void))(*((uint32_t *) 0x1fff0004));
|
bootJump = (void(*)(void))(*((uint32_t *) 0x1FFF0004));
|
||||||
bootJump();
|
bootJump();
|
||||||
while (1);
|
while (1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue