Open ali1234 opened 3 years ago
The suffix is this portion here: https://github.com/32blit/32blit-sdk/blob/dd9d68df7246eb220abc71168d7e5ceee4cf3de6/tools/dfu#L117-L122
Which, according to this datasheet: http://rc.fdr.hu/UM0391.pdf
● The bcdDevice field gives the firmware version contained in the file, or 0xFFFF if ignored. ● The idProduct and idVendor field give the Product ID and Vendor ID respectively of the device that the file is intended for, or 0xFFFF if the field is ignored. ● The bcdDFU field, fixed to 0x011A, gives the DFU specification number. This value differs from that specified in standard DFU rev1.1. ● The ucSignature field contains a fixed string of three unsigned characters (44h, 46h, 55h). In the file they appear in reverse order, allowing valid DFU files to be recognized. ● The bLength field, currently fixed to 16, gives the length of the DFU Suffix itself in bytes. ● The dwCRC (Cyclic Redundancy Check) field is the CRC calculated over the whole file except for the dwCRC data itself
And to meet the conditions for the CRC:
This all looks right, insofar as there isn't much to get wrong.
Maybe - contrary to the comments at the top of the DFU tool - the suffix should be included in the file length: https://github.com/32blit/32blit-sdk/blob/dd9d68df7246eb220abc71168d7e5ceee4cf3de6/tools/dfu#L55
Edit: "DFU File Format" PDF attached here for posterity: DFU-File-Format-UM0391.pdf
P.S. What's your DFU Util version and flash command?
On Ubuntu I see a different flavour of wrong:
dfu-util -D firmware.dfu -d 0x483:0xdf11 -a 0
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
Opening DFU capable USB device...
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 1024
dfu-util: Error: File ID 0483:0000 does not match device (0483:df11 or 0483:df11)
IE: The DFU file has 0000 as the Product ID so it will refuse to flash.
Okay I found the problem. I typed firmware.bin
instead of firmware.dfu
and apparently this actually works, but produces the warning because no suffix.
0000 is probably because of this:
https://github.com/32blit/32blit-sdk/blob/master/tools/dfu#L190
Over in the new DFU tool the default is still 0 for product ID:
https://github.com/32blit/32blit-tools/blob/master/src/ttblit/core/dfu.py#L121
That's definitely an oversight, should be df11
. Me abandoning DFuSe in favour of Linux has not helped this.
When flashing the latest firmware on linux I get this warning message:
I am not sure what this means but we should look into it to avoid it breaking at some point in the future.
I suspect it means there is some invalid header on the firmware.dfu.