diff options
| author | Oliver Joos <oliver.joos@hispeed.ch> | 2023-08-25 00:09:27 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-09-01 12:39:06 +1000 |
| commit | a175f98a65173e254d4185e51f49b11cab20ffac (patch) | |
| tree | 92d5b198b5de2008ef216bdfe3d8b9d1dd92446b | |
| parent | 32db4c58f7aebc18e425f67e9f2585a79d34febf (diff) | |
stm32/mboot: Fix fwupdate by replacing zlib with new deflate module.
Since commit 3533924c36ae85ce6e8bf8598dd71cf16bbdb10b the zlib module has
been replaced by the new deflate module. This commit updates the script
fwupdate.py to use the new deflate module.
Signed-off-by: Oliver Joos <oliver.joos@hispeed.ch>
| -rw-r--r-- | ports/stm32/mboot/fwupdate.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ports/stm32/mboot/fwupdate.py b/ports/stm32/mboot/fwupdate.py index 78a8d7365..47ceb19ba 100644 --- a/ports/stm32/mboot/fwupdate.py +++ b/ports/stm32/mboot/fwupdate.py @@ -3,7 +3,7 @@ from micropython import const import struct, time -import zlib, machine, stm +import deflate, machine, stm # Constants to be used with update_mpy VFS_FAT = 1 @@ -36,7 +36,7 @@ def dfu_read(filename): if hdr == b"Dfu": pass elif hdr == b"\x1f\x8b\x08": - f = zlib.DecompIO(f, 16 + 15) + f = deflate.DeflateIO(f, deflate.GZIP) else: print("Invalid firmware", filename) return None @@ -231,7 +231,7 @@ def update_app_elements( # Check firmware is of .dfu or .dfu.gz type try: with open(filename, "rb") as f: - hdr = zlib.DecompIO(f, 16 + 15).read(6) + hdr = deflate.DeflateIO(f, deflate.GZIP).read(6) except Exception: with open(filename, "rb") as f: hdr = f.read(6) |
