Skip to content

Commit

Permalink
Merge pull request #879 from luxonis/update_flash_bl
Browse files Browse the repository at this point in the history
Updated flash_bootlaoder example, so it will try to flash user BL
  • Loading branch information
themarpe authored Aug 14, 2023
2 parents 8af147b + c971026 commit 1286b16
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/bootloader/flash_bootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@

# Create a progress callback lambda
progress = lambda p : print(f'Flashing progress: {p*100:.1f}%')

print(f"Flashing {blType.name} bootloader...")
startTime = time.monotonic()
(res, message) = bl.flashBootloader(dai.DeviceBootloader.Memory.FLASH, blType, progress)
is_user_bl = bl.isUserBootloaderSupported()
print(f"Flashing {blType.name} {'USER' if is_user_bl else 'FACTORY'} bootloader...")
if is_user_bl:
(res, message) = bl.flashUserBootloader(progress)
else: # Factory bootloader
(res, message) = bl.flashBootloader(dai.DeviceBootloader.Memory.FLASH, blType, progress)
if res:
print("Flashing successful. Took", time.monotonic() - startTime, "seconds")
else:
Expand Down

0 comments on commit 1286b16

Please sign in to comment.