X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=tools%2Fupdate-firmware;h=cd711241ab3858d6e62cb366b1d376549ae48f47;hb=defaea09b33884a4dd17f89e11c7a565605ae2d2;hp=f610343f37c8ba1fb672b73e49ac37c2fde44841;hpb=6c782c1ea136dd3968ae611a61bd5512cf5c009e;p=gps-watch.git diff --git a/tools/update-firmware b/tools/update-firmware index f610343..cd71124 100755 --- a/tools/update-firmware +++ b/tools/update-firmware @@ -168,6 +168,13 @@ class Application: sys.stderr.write('File too large.\n') return 3 + # The bootloader only accepts chunks whose size is word-aligned: + num_extra = len(chunks[-1]) & 3 + + if num_extra != 0: + num_pad = 4 - extra + chunks[-1] += b'\xff' * num_pad + # Defaulting to zero seems too dangerous: if self._offset is None: sector0 = None