Skip to content

Commit e1a8b2b

Browse files
committed
Always delay after launching the bootloader
1 parent 5867449 commit e1a8b2b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

universal_silabs_flasher/flasher.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
_LOGGER = logging.getLogger(__name__)
4242

43-
EZSP_BOOTLOADER_LAUNCH_DELAY = 5
43+
BOOTLOADER_LAUNCH_DELAY = 3
4444

4545

4646
@dataclasses.dataclass(frozen=True)
@@ -214,6 +214,8 @@ async def trigger_bootloader_reset(
214214
_LOGGER.info(f"Triggering {target.value} bootloader")
215215
await self.trigger_bootloader(target)
216216

217+
await asyncio.sleep(BOOTLOADER_LAUNCH_DELAY)
218+
217219
# Try probing the bootloader at all known baudrates
218220
bootloader_baudrates = [
219221
baudrate
@@ -377,11 +379,11 @@ async def enter_bootloader(self) -> None:
377379
raise RuntimeError(
378380
f"EmberZNet could not enter the bootloader: {res[0]!r}"
379381
)
380-
381-
await asyncio.sleep(EZSP_BOOTLOADER_LAUNCH_DELAY)
382382
else:
383383
raise RuntimeError(f"Invalid application type: {self.app_type}")
384384

385+
await asyncio.sleep(BOOTLOADER_LAUNCH_DELAY)
386+
385387
# Probe the bootloader baudrate if not already known
386388
if self.bootloader_baudrate is None:
387389
await self.probe_app_type(only=[ApplicationType.GECKO_BOOTLOADER])

0 commit comments

Comments
 (0)