diff --git a/ckcc/__init__.py b/ckcc/__init__.py index 1108766..ee932a7 100644 --- a/ckcc/__init__.py +++ b/ckcc/__init__.py @@ -1,6 +1,6 @@ # (c) Copyright 2021 by Coinkite Inc. This file is covered by license found in COPYING-CC. -__version__ = '1.2.0' +__version__ = '1.2.1' __all__ = [ "client", "protocol", "constants" ] diff --git a/ckcc/sigheader.py b/ckcc/sigheader.py index a39ac43..ff4eb07 100644 --- a/ckcc/sigheader.py +++ b/ckcc/sigheader.py @@ -1,5 +1,4 @@ -# Autogen'ed file, don't edit. See bootloader/mk-sigheader.h for original - +# (c) Copyright 2018-2022 by Coinkite Inc. This file is covered by license found in COPYING-CC. # Our simple firmware header. # Although called a header, this data is placed into the middle of the binary. @@ -11,10 +10,9 @@ # - version_string is for humans only # - pubkey_num indicates which pubkey was used for signature # - firmware_length, must be: -# - bigger than minimum length, less than max -# - 512-byte aligned +# - bigger than minimum length, less than max +# - 512-byte aligned # - bootloader assumes the flash filesystem (FAT FS) follows the firmware. -# - this C header file is somewhat parsed and used by python signature-adding code # - timestamp is YYMMDDHHMMSS0000 in BCD @@ -23,23 +21,37 @@ FW_HEADER_OFFSET = (0x4000-FW_HEADER_SIZE) FW_HEADER_MAGIC = 0xCC001234 +# Firmware Image Size + # arbitrary min size FW_MIN_LENGTH = (256*1024) -# absolute max: 1MB flash - 32k for bootloader + +# (mk1-3) absolute max size: 1MB flash - 32k for bootloader # practical limit for our-protocol USB upgrades: 786432 (or else settings damaged) FW_MAX_LENGTH = (0x100000 - 0x8000) +# .. for Mk4: 2Mbytes, less bootrom of 128k. +FW_MAX_LENGTH_MK4 = (0x200000 - 0x20000) + # Arguments to be used w/ python's struct module. -FWH_PY_FORMAT = "