Skip to content

Commit

Permalink
🔨 [2.0.9.7] Use older chitu_crypt.py
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jul 4, 2023
1 parent 5ac0c72 commit 743d310
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/**
* Marlin release version identifier
*/
//#define SHORT_BUILD_VERSION "2.0.9.6"
//#define SHORT_BUILD_VERSION "2.0.9.7"

/**
* Verbose version identifier which should contain a reference to the location
Expand All @@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2023-03-25"
//#define STRING_DISTRIBUTION_DATE "2023-07-04"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/inc/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Release version. Leave the Marlin version or apply a custom scheme.
*/
#ifndef SHORT_BUILD_VERSION
#define SHORT_BUILD_VERSION "2.0.9.6"
#define SHORT_BUILD_VERSION "2.0.9.7"
#endif

/**
Expand All @@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2023-03-25"
#define STRING_DISTRIBUTION_DATE "2023-07-04"
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion buildroot/bin/use_example_configs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Examples:
# use_example_configs
# use_example_configs Creality/CR-10/CrealityV1
# use_example_configs release-2.0.9.6:Creality/CR-10/CrealityV1
# use_example_configs release-2.0.9.7:Creality/CR-10/CrealityV1
#
# If a configpath has spaces (or quotes) escape them or enquote the path
#
Expand Down
27 changes: 9 additions & 18 deletions buildroot/share/PlatformIO/scripts/chitu_crypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#
import pioutil
if pioutil.is_pio_build():
import struct,uuid,marlin

board = marlin.env.BoardConfig()
import os,random,struct,uuid,marlin
# Relocate firmware from 0x08000000 to 0x08008800
marlin.relocate_firmware("0x08008800")

def calculate_crc(contents, seed):
accumulating_xor_value = seed;
Expand Down Expand Up @@ -105,22 +105,13 @@ def encrypt_file(input, output_file, file_length):

# Encrypt ${PROGNAME}.bin and save it as 'update.cbd'
def encrypt(source, target, env):
from pathlib import Path

fwpath = Path(target[0].path)
fwsize = fwpath.stat().st_size
firmware = open(target[0].path, "rb")
update = open(target[0].dir.path + '/update.cbd', "wb")
length = os.path.getsize(target[0].path)

enname = board.get("build.crypt_chitu")
enpath = Path(target[0].dir.path)
encrypt_file(firmware, update, length)

fwfile = fwpath.open("rb")
enfile = (enpath / enname).open("wb")
firmware.close()
update.close()

print(f"Encrypting {fwpath} to {enname}")
encrypt_file(fwfile, enfile, fwsize)
fwfile.close()
enfile.close()
fwpath.unlink()

marlin.relocate_firmware("0x08008800")
marlin.add_post_action(encrypt);
2 changes: 1 addition & 1 deletion config/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Where have all the configurations gone?

## https://github.com/MarlinFirmware/Configurations/archive/release-2.0.9.6.zip
## https://github.com/MarlinFirmware/Configurations/archive/release-2.0.9.7.zip

0 comments on commit 743d310

Please sign in to comment.