summaryrefslogtreecommitdiff
path: root/tools/pydfu.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pydfu.py')
-rwxr-xr-xtools/pydfu.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/pydfu.py b/tools/pydfu.py
index 3f11de067..a33e49712 100755
--- a/tools/pydfu.py
+++ b/tools/pydfu.py
@@ -168,7 +168,7 @@ def write_memory(addr, buf, progress=None, progress_addr=0, progress_size=0):
print ("Addr 0x%x %dKBs/%dKBs..." % (xfer_base + xfer_bytes,
xfer_bytes // 1024,
xfer_total // 1024))
- if progress and xfer_count % 256 == 0:
+ if progress and xfer_count % 2 == 0:
progress(progress_addr, xfer_base + xfer_bytes - progress_addr,
progress_size)
@@ -176,7 +176,9 @@ def write_memory(addr, buf, progress=None, progress_addr=0, progress_size=0):
set_address(xfer_base+xfer_bytes)
# Send DNLOAD with fw data
- chunk = min(64, xfer_total-xfer_bytes)
+ # the "2048" is the DFU transfer size supported by the ST DFU bootloader
+ # TODO: this number should be extracted from the USB config descriptor
+ chunk = min(2048, xfer_total-xfer_bytes)
__dev.ctrl_transfer(0x21, __DFU_DNLOAD, 2, __DFU_INTERFACE,
buf[xfer_bytes:xfer_bytes + chunk], __TIMEOUT)