aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Wakefield <jackwakefield@protonmail.com>2024-09-15 18:45:04 +0100
committerKevinOConnor <kevin@koconnor.net>2024-09-22 19:26:18 -0400
commitb4aca122a15c7223defb251dc4d8b48ce1ccb897 (patch)
tree60d0e6a38485ee8fe2089ab5383720533a7b4c71
parentd9236f1c20ea603e456f959d0914b72b1d730e86 (diff)
downloadkutter-b4aca122a15c7223defb251dc4d8b48ce1ccb897.tar.gz
kutter-b4aca122a15c7223defb251dc4d8b48ce1ccb897.tar.xz
kutter-b4aca122a15c7223defb251dc4d8b48ce1ccb897.zip
flash_usb: Wait for busnum file to exist when flashing with picoboot
This solves an issue where the USB directory could exist, but the busnum file itself may not exist immediately. This was encountered when flashing a Pico connected to a Raspberry Pi 5. Signed-off-by: Jack Wakefield <jackwakefield@protonmail.com>
-rwxr-xr-xscripts/flash_usb.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/flash_usb.py b/scripts/flash_usb.py
index 33c43760..e5f5632a 100755
--- a/scripts/flash_usb.py
+++ b/scripts/flash_usb.py
@@ -198,7 +198,7 @@ def flash_picoboot(device, binfile, sudo):
# We need one level up to get access to busnum/devnum files
usbdir = os.path.dirname(devpath)
enter_bootloader(device)
- wait_path(usbdir)
+ wait_path(usbdir + "/busnum")
with open(usbdir + "/busnum") as f:
bus = f.read().strip()
with open(usbdir + "/devnum") as f: