summaryrefslogtreecommitdiff
path: root/tools/pydfu.py
AgeCommit message (Collapse)Author
2025-02-25all: Upgrade to ruff v0.9.6.Christian Clauss
Signed-off-by: Christian Clauss <cclauss@me.com>
2023-10-03all: Fix various spelling mistakes found by codespell 2.2.6.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-05-24tools/pydfu.py: Use getattr to retrieve getargspec function.Damien George
Since Python 3.11, inspect.getargspec() has been removed. Signed-off-by: Damien George <damien@micropython.org>
2023-04-27all: Fix spelling mistakes based on codespell check.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-12-09all: Update Python formatting to latest Black version 21.12b0.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-05-21tools/pydfu.py: Remove default VID/PID values.Tobias Thyrrestrup
As the new default behaviour, this allows PyDFU to be used with all devices, not just the ones matching a specific set of VID/PID values. But it's still possible to specify VID/PID if needed to narrow down the selection of the USB device. Signed-off-by: Tobias Thyrrestrup <tt@LEGO.com>
2021-02-23tools/pydfu.py: Support DFU files with elements of zero size.Damien George
Instead of raising a ZeroDivisionError, this tool now just skips any elements in the DFU file that have zero size. Signed-off-by: Damien George <damien@micropython.org>
2020-07-01Revert "tools/pydfu.py: Respect longer timeouts requested by DFU dev..."Andrew Leech
This reverts commit 4d6f60d4286b3e6ea8c9fb0141ba13e4978882b6. This implementation used the timeout as a maximum amount of time needed for the operation, when actually the spec and other tools suggest that it's the minumum delay needed between subsequent USB transfers.
2020-06-30tools/pydfu.py: Respect longer timeouts requested by DFU device/mboot.Andrew Leech
2020-03-22tools/pydfu.py: Display any error strings from device/mboot.Andrew Leech
2020-03-22tools/pydfu.py: Add args for VID/PID & exit with cleaner error handling.Andrew Leech
2020-02-28all: Reformat C and Python source code with tools/codeformat.py.Damien George
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-01-23tools/pydfu.py: Clean up syntax, update comments and docstrings.c0rejump
Some parts of code have been aligned to increase readability. In general '' instead of "" were used wherever possible to keep the same convention for entire file. Import inspect line has been moved to the top according to hints reported by pep8 tools. A few extra spaces were removed, a few missing spaces were added. Comments have been updated, mostly in "read_dfu_file" function. Some other comments have been capitalized and/or slightly updated. A few docstrings were fixed as well. No real code changes intended.
2018-12-30tools/pydfu.py: Fix regression so tool runs under Python 2 again.Dave Hylands
Under python3 (tested with 3.6.7) bytes with a list of integers as an argument returns a different result than under python 2.7 (tested with 2.7.15rc1) which causes pydfu.py to fail when run under 2.7. Changing bytes to bytearray makes pydfu work properly under both Python 2.7 and Python 3.6.
2018-11-27tools/pydfu.py: Improve DFU reset, and auto-detect USB transfer size.Damien George
A DFU device must be in the idle state before it can be programmed, and this requires either clearing the status or aborting, depending on its current state. Code is added to do this. And the USB transfer size is now automatically detected so devices with a size less than 2048 bytes work correctly.
2018-09-21tools/pydfu: Workaround stdio flush error on Windows with Python 3.6.Andrew Leech
There appears to be an issue on Windows with CPython >= 3.6, sys.stdout.flush() raises an exception: OSError: [WinError 87] The parameter is incorrect It works fine to just catch and ignore the error on the flush line. Tested on Windows 10 x64 1803 (Build 17134.228), Python 3.6.4 amd64.
2018-07-27tools/pydfu.py: Make the DFU tool work again with Python 2.roland
This patch will work for both Python 2 and 3.
2018-07-20tools/pydfu.py: Use getfullargspec instead of getargspec for newer pyusbroland
pyusb v1.0.2 warns about `getargspec` as being deprecated.
2018-06-22tools/pydfu.py: Add support for multiple memory segments.Damien George
Segments are separated by / and begin with the memory address. This follows how the ST DFU tool works.
2018-06-08tools/pydfu.py: Increase download packet size to full 2048 bytes.Damien George
The ST DFU bootloader supports a transfer size up to 2048 bytes, so send that much data on each download (to device) packet. This almost halves total download time.
2018-05-18tools/pydfu.py: Fix typo in comments.Keith Wiley
2017-12-14tools/pydfu.py: Call set_configuration() on fresh USB device object.Damien George
This call is required before using the device (some operating systems don't need it but others do). Fixes issue #3476.
2015-07-06tools: Fix pydfu.py to work with old and new versions of PyUSBDave Hylands
Update pydfu.py to match with the version from openmv. I just updated the openmv version to work with both of the PyUSB 1.0.0.b1 and 1.0.0.b2 See: https://github.com/walac/pyusb/blob/master/ReleaseNotes.rst
2014-10-22tools, pydfu: Some fixes to support Python 3.Damien George
2014-10-22Add pydfu.py to the micropython tree. Use dfu_util bgy defaultDave Hylands
You can do: make USE_PYDFU=1 deploy to use pydfu.py