application: use new bootloader method

This commit is contained in:
King Kévin 2020-01-02 13:01:40 +01:00
parent 55b30588ed
commit 7ea7be810d
1 changed files with 6 additions and 2 deletions

View File

@ -273,8 +273,12 @@ static void command_reset(void* argument)
static void command_bootloader(void* argument)
{
(void)argument; // we won't use the argument
RCC_CSR |= RCC_CSR_RMVF; // clear reset flags
scb_reset_core(); // reset core (the bootloader will interpret it as starting into DFU)
// set DFU magic to specific RAM location
__dfu_magic[0] = 'D';
__dfu_magic[1] = 'F';
__dfu_magic[2] = 'U';
__dfu_magic[3] = '!';
scb_reset_system(); // reset system (core and peripherals)
while (true); // wait for the reset to happen
}