Commit Graph

167 Commits

Author SHA1 Message Date
Richard Hughes
dc3856b51d trivial: Fix a tiny memory leak when writing DfuSe images
Found using Coverity, many thanks.
2017-05-08 20:32:15 +01:00
Richard Hughes
183c56e712 Support signed Intel HEX files
The record type 0xfd is nonstandard but used in at least one product to avoid
having an additional signing key file.
2017-04-20 15:36:56 +01:00
Richard Hughes
3f3cb69bb7 trivial: Generate the pkg-config files using meson 2017-04-20 08:07:38 +01:00
Richard Hughes
1fdb335025 Remove the automake build system 2017-04-13 18:42:08 +01:00
Richard Hughes
57746cb839 Add the Meson build system as an alternate to autotools
Automake and autoconf are impossible to fully understand and Meson now provides
everything we need for a much smaller, faster, and more understandable build.

See http://mesonbuild.com/ for more information.
2017-04-12 16:35:18 +01:00
Richard Hughes
f63091e413 Add DFU quirk for OpenPICC 2017-03-11 20:47:32 +00:00
Richard Hughes
5eb8e29fa2 Add DFU quirk for SIMtrace 2017-03-11 20:47:22 +00:00
Mario Limonciello
ca9dadcc52 trivial: move gelf.h include to HAVE_LIBELF (#87) 2017-02-14 11:09:46 -06:00
Kai Krakow
1c7ea9ee2d Fix compiler warnings
My compiler doesn't understand -Wno-discard-qualifiers so drop it and
fix the warnings instead. I think it is better to explicitly fix them
anyways instead of just to ignore the discarded const qualifier in
general.

I think the option should be avoided in hand-written code. The warning
is there for a reason: To protect you from possibly overwriting data you
expect to not be modified when passing pointers around.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41215
2017-02-13 10:02:25 +00:00
Richard Hughes
fcca6f67b2 Include all debug messages when run with --verbose 2017-01-11 16:50:17 +00:00
Richard Hughes
c7ea2a2369 trivial: Fix up two compile warnings 2017-01-07 22:10:14 +00:00
Richard Hughes
66a24da646 trivial: Actually allow compiling with libelf 2017-01-07 22:07:13 +00:00
Richard Hughes
ba79b07b4f libdfu: Don't read data from some DfuSe targets
The option bytes section makes no sense to include in the flashed image.
2017-01-07 21:13:51 +00:00
Richard Hughes
6d9d985f1b trivial: Fix a gtk-doc header issue 2016-12-13 16:02:50 +00:00
Richard Hughes
d8e8134bdf trivial: Move the libdfu test files to under libdfu 2016-12-12 11:17:11 +00:00
Richard Hughes
bc93e4ab6e Make all providers and plugins share a GUsbContext
This means we don't have more that one thread just watching for the USB
hotplug events. To achieve this split up the coldplug into setup and coldplug
phases and run the enumerate just once in the daemon.
2016-12-08 19:51:55 +00:00
Richard Hughes
1deda31cae Make libelf support optional 2016-11-22 15:39:57 +00:00
Richard Hughes
0e77c525dd trivial: Fix the last commit to actually compile 2016-11-22 08:30:30 +00:00
Tsunghan Liu (Robert Liu)
a02bbb1c4e * close USB devices before error returns (#73) 2016-11-21 09:12:28 -06:00
Richard Hughes
c8c2d60d65 trivial: Fix error check when parsing Neo Freerunner descriptor
Found using Coverity.
2016-11-09 20:14:15 +00:00
Richard Hughes
dfb30d930a trivial: Fix a typo when matching device VID:PIDs
Found using Coverity.
2016-11-09 19:35:23 +00:00
Richard Hughes
b28daac301 libdfu: Use a heuristic for the start address if the firmware has no DfuSe footer
This fixes flashing into the 96Boards BLE Carbon.
2016-11-03 15:11:25 +00:00
Richard Hughes
ae7935448b libdfu: Correctly set the element address when uploading from DfuSe devices 2016-10-16 08:26:01 +01:00
Richard Hughes
6c17d2ed43 trivial: Fix an error path when the interface cannot be claimed 2016-10-16 08:26:01 +01:00
Mario Limonciello
a91214f545 Enable hardening flags on more binaries 2016-10-14 12:43:02 -05:00
Richard Hughes
bd81a89044 libdfu: Correctly erase DfuSe devices 2016-10-14 18:07:34 +01:00
Richard Hughes
21806b4696 libdfu: Wait for DNBUSY to be cleared when checking the DfuSe status 2016-10-14 18:07:34 +01:00
Richard Hughes
9e172a0b1f trivial: Raise the default timeout for DFU operations
Not all devices are fast, and the ST bootloader takes a long time to return
from erase.
2016-10-14 18:07:34 +01:00
Richard Hughes
503f057d3e libdfu: Add dfu_sector_get_zone() to get the continuous memory zone number 2016-10-14 18:07:34 +01:00
Richard Hughes
8e480bff54 trivial: Show the caps as letters when listing sectors as a string 2016-10-14 18:07:34 +01:00
Richard Hughes
79d2b93771 Add a 'replace-data' command to dfu-tool
This allows us to search-and-replace data in a firmware file that may be
protected with a checksum or CRC.
2016-10-14 18:07:34 +01:00
Richard Hughes
0e7877b831 trivial: Fix self tests after fixing sector addresses 2016-10-14 18:07:34 +01:00
Richard Hughes
35bea355b2 libdfu: Match the device booloader or runtime VID and PID when checking firmware 2016-10-14 18:07:34 +01:00
Richard Hughes
91685ce43b libdfu: Add quirks for HydraBus as it does not have a DFU runtime 2016-10-14 18:07:34 +01:00
Richard Hughes
8e2e46e60b libdfu: Re-get the quirks when the DfuDevice gets a new GUsbDevice 2016-10-14 18:07:34 +01:00
Richard Hughes
1ff658dbb2 libdfu: Ensure the mode is set correctly when faking a runtime 2016-10-14 18:07:34 +01:00
Richard Hughes
bacf255428 libdfu: Ensure the device is open before claiming the interface 2016-10-14 18:07:34 +01:00
Richard Hughes
a5c48ce07f libdfu: Fix verification of written DfuSe firmware
DfuSe doesn't stop returning data when the image is empty. Take as least as
much data as we require and then truncate the result to what we want.
2016-10-14 18:07:34 +01:00
Richard Hughes
73b63c87e8 libdfu: Do not do a zero-byte download when in DfuSe mode
For ST devices this means 'boot into APP mode' which we can also now populate.
2016-10-14 18:07:34 +01:00
Richard Hughes
8a3c18b4a3 libdfu: Use an animated progress bar when performing DFU operations 2016-10-14 18:07:34 +01:00
Richard Hughes
99f61c827a libdfu: Add DfuAction enumerated value to represent a device action
This is a high level operation which is supposed to correlate with the
percentage change notification. Using the device DfuState or DfuStatus doesn't
work when doing dfuse operations.
2016-10-13 19:43:20 +01:00
Richard Hughes
9117686b4c libdfu: Use the device offset when writing DfuSe firmware 2016-10-12 21:33:30 +01:00
Richard Hughes
cbdeca25e2 libdfu: Fix uploading from DfuSe devices 2016-10-12 20:36:27 +01:00
Richard Hughes
fa522907e9 libdfu: Do not do GetStatus on dfuse upload 2016-10-12 20:30:36 +01:00
Richard Hughes
5e40ae8778 libdfu: Correctly offset addresses when one zone has multiple sectors 2016-10-12 20:29:08 +01:00
Richard Hughes
41541213b1 trivial: Prefix some DfuSe errors with useful data 2016-10-12 16:39:23 +01:00
Richard Hughes
e9dbf70cd3 libdfu: Fix two possible critical warnings for corrupt USB descriptors 2016-10-12 16:15:58 +01:00
Richard Hughes
ac614987e6 Show the nicely formatted target name for DfuSe devices 2016-10-12 15:05:41 +01:00
Richard Hughes
053ade98e8 trivial: Only show the cipher kind if set 2016-10-12 15:05:23 +01:00
Richard Hughes
2fd030e663 trivial: Print the transfer size in the 'dfu-tool list' output 2016-10-12 15:05:03 +01:00