Apparent fix for .dfu not being generated.

TODO: Does not address the fact that make continues despite the .dfu creation failure...
This commit is contained in:
Jared Boone
2014-02-18 17:05:53 -08:00
parent a16d513103
commit e3025e94ff

View File

@ -135,7 +135,7 @@ $(BINARY).dfu: $(BINARY).bin
$(Q)rm -f _tmp.dfu _header.bin $(Q)rm -f _tmp.dfu _header.bin
$(Q)cp $(BINARY).bin _tmp.dfu $(Q)cp $(BINARY).bin _tmp.dfu
$(Q)dfu-suffix --vid=0x1fc9 --pid=0x000c --did=0x0 -s 0 -a _tmp.dfu $(Q)dfu-suffix --vid=0x1fc9 --pid=0x000c --did=0x0 -s 0 -a _tmp.dfu
$(Q)python -c "import os.path; import struct; print('0000000: da ff ' + ' '.join(map(lambda s: '%02x' % ord(s), struct.pack('<H', os.path.getsize('$(*).bin') / 512 + 1))) + ' ff ff ff ff')" | xxd -g1 -r > _header.bin $(Q)python -c "import os.path; import struct; print('0000000: da ff ' + ' '.join(map(lambda s: '%02x' % ord(s), struct.pack('<H', os.path.getsize('$(BINARY).bin') / 512 + 1))) + ' ff ff ff ff')" | xxd -g1 -r > _header.bin
$(Q)cat _header.bin _tmp.dfu >$(BINARY).dfu $(Q)cat _header.bin _tmp.dfu >$(BINARY).dfu
$(Q)rm -f _tmp.dfu _header.bin $(Q)rm -f _tmp.dfu _header.bin