Commit f5556c3e authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

imgtool: fix header padding value check

Commit 9117fded added support for
supplying an `--erased-val`, which defaults to 0xff. When padding a
header, the checks were still validating against 0, which is the
value used for padding by the Zephyr build system. Now when the
user passes `--pad-header` this check is skipped (we already know
the contents).

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent d0ca0ffc
Loading
Loading
Loading
Loading
+1 −1
Changes for scripts/imgtool/image.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -197,7 +197,7 @@ class Image():
        """Perform some sanity checking of the image."""
        # If there is a header requested, make sure that the image
        # starts with all zeros.
        if self.header_size > 0:
        if self.header_size > 0 and not self.pad_header:
            if any(v != 0 for v in self.payload[0:self.header_size]):
                raise Exception("Padding requested, but image does not start with zeros")
        if self.slot_size > 0: