Commit 42b32394 authored by Roman Okhrimenko's avatar Roman Okhrimenko
Browse files

imgtool: Add possibility to set confirm flag for hex files as well

Fix imgtool does not take into account value of confirm flag, when signing .hex images

Signed-off-by: default avatarRoman Okhrimenko <roman.okhrimenko@cypress.com>
parent b2a1a485
Loading
Loading
Loading
Loading
+6 −3
Changes for scripts/imgtool/image.py: 6 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -219,9 +219,12 @@ class Image():
                                                  self.save_enctlv,
                                                  self.enctlv_len)
                trailer_addr = (self.base_addr + self.slot_size) - trailer_size
                padding = bytes([self.erased_val] *
                                (trailer_size - len(boot_magic))) + boot_magic
                h.puts(trailer_addr, padding)
                padding = bytearray([self.erased_val] * 
                                    (trailer_size - len(boot_magic)))
                if self.confirm and not self.overwrite_only:
                    padding[-MAX_ALIGN] = 0x01  # image_ok = 0x01
                padding += boot_magic
                h.puts(trailer_addr, bytes(padding))
            h.tofile(path, 'hex')
        else:
            if self.pad: