Skip to content

Commit

Permalink
use wait function for bootloader_jump
Browse files Browse the repository at this point in the history
  • Loading branch information
dexter93 committed Mar 3, 2022
1 parent 3a3b621 commit 45fd6d3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions platforms/chibios/bootloaders/sn32_dfu.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <ch.h>
#include <hal.h>
#include "wait.h"

# define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0))
extern uint32_t __ram0_end__;
Expand All @@ -27,10 +28,7 @@ extern uint32_t __ram0_end__;
__attribute__((weak)) void bootloader_jump(void) {
*MAGIC_ADDR = BOOTLOADER_MAGIC; // set magic flag => reset handler will jump into boot loader
// Wait for memory to be set before the reset
// FIXME: update to wait funcion
for(volatile uint32_t i = 0; i < 32; i++){
__NOP();
}
wait_us(1);
NVIC_SystemReset();
}

Expand Down

0 comments on commit 45fd6d3

Please sign in to comment.