Skip to content

Commit 5a2f115

Browse files
committed
nrf52 Bootloader 8.2 for Moddable Four - delay before reboot after installing
1 parent edefc5e commit 5a2f115

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

lib/sdk11/components/libraries/bootloader_dfu/bootloader.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,15 @@ extern void tud_vendor_task(void);
144144
(m_update_status == BOOTLOADER_TIMEOUT) ||
145145
(m_update_status == BOOTLOADER_RESET) )
146146
{
147+
extern uint32_t tusb_hal_millis(void);
148+
if (m_update_status == BOOTLOADER_COMPLETE) {
149+
static uint32_t finishedTime = 0;
150+
if (finishedTime == 0)
151+
finishedTime = tusb_hal_millis() + 500;
152+
if (tusb_hal_millis() > finishedTime)
153+
return;
154+
}
155+
else
147156
// When update has completed or a timeout/reset occured we will return.
148157
return;
149158
}

src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void usb_teardown(void);
8787
#include "dfu_qspi.h"
8888
#include "dfu_uart.h"
8989

90-
#define BOOTLOADER_VERSION 0x0801
90+
#define BOOTLOADER_VERSION 0x0802
9191
// found in BOOTLOADER_VER_MEM 0x200041D0
9292

9393
//--------------------------------------------------------------------+
@@ -399,7 +399,7 @@ else
399399
bootloader_app_start();
400400
}
401401

402-
NVIC_SystemReset();
402+
// NVIC_SystemReset();
403403
}
404404

405405
/**

0 commit comments

Comments
 (0)