Age | Commit message (Collapse) | Author |
|
Signed-off-by: Christian Clauss <cclauss@me.com>
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
Since Python 3.11, inspect.getargspec() has been removed.
Signed-off-by: Damien George <damien@micropython.org>
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
|
|
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>
|
|
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>
|
|
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.
|
|
|
|
|
|
|
|
This is run with uncrustify 0.70.1, and black 19.10b0.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
This patch will work for both Python 2 and 3.
|
|
pyusb v1.0.2 warns about `getargspec` as being deprecated.
|
|
Segments are separated by / and begin with the memory address. This
follows how the ST DFU tool works.
|
|
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.
|
|
|
|
This call is required before using the device (some operating systems don't
need it but others do). Fixes issue #3476.
|
|
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
|
|
|
|
You can do:
make USE_PYDFU=1 deploy
to use pydfu.py
|