We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 01aeb48 + 434d86b commit 091da53Copy full SHA for 091da53
tools/build_api.py
@@ -398,8 +398,9 @@ def _fill_header(region_list, current_region):
398
else:
399
ih = intelhex_offset(region_dict[data].filename, offset=region_dict[data].start)
400
if subtype.startswith("CRCITT32"):
401
- fmt = {"CRCITT32be": ">l", "CRCITT32le": "<l"}[subtype]
402
- header.puts(start, struct.pack(fmt, zlib.crc32(ih.tobinarray())))
+ fmt = {"CRCITT32be": ">L", "CRCITT32le": "<L"}[subtype]
+ crc_val = zlib.crc32(ih.tobinarray()) & 0xffffffff
403
+ header.puts(start, struct.pack(fmt, crc_val))
404
elif subtype.startswith("SHA"):
405
if subtype == "SHA256":
406
hash = hashlib.sha256()
0 commit comments