Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@
#elif MB(CREALITY_V25S1)
#include "stm32f1/pins_CREALITY_V25S1.h" // STM32F1 env:STM32F103RE_creality_smartPro env:STM32F103RE_creality_smartPro_maple
#elif MB(TRIGORILLA_PRO)
#include "stm32f1/pins_TRIGORILLA_PRO.h" // STM32F1 env:trigorilla_pro env:trigorilla_pro_maple
#include "stm32f1/pins_TRIGORILLA_PRO.h" // STM32F1 env:trigorilla_pro env:trigorilla_pro_maple env:trigorilla_pro_disk
#elif MB(FLY_MINI)
#include "stm32f1/pins_FLY_MINI.h" // STM32F1 env:FLY_MINI env:FLY_MINI_maple
#elif MB(FLSUN_HISPEED)
Expand Down
19 changes: 15 additions & 4 deletions buildroot/share/PlatformIO/scripts/chitu_crypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#
import pioutil
if pioutil.is_pio_build():
import struct,uuid
import struct,uuid,marlin

board = marlin.env.BoardConfig()

def calculate_crc(contents, seed):
accumulating_xor_value = seed;
Expand Down Expand Up @@ -104,12 +106,21 @@ 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

enname = board.get("build.crypt_chitu")
enpath = Path(target[0].dir.path)

fwfile = fwpath.open("rb")
upfile = Path(target[0].dir.path, 'update.cbd').open("wb")
encrypt_file(fwfile, upfile, fwsize)
enfile = (enpath / enname).open("wb")

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

import marlin
marlin.relocate_firmware("0x08008800")
marlin.add_post_action(encrypt);
19 changes: 19 additions & 0 deletions ini/stm32f1.ini
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,31 @@ build_flags = ${stm32_variant.build_flags}
build_unflags = ${stm32_variant.build_unflags}
-DUSBCON -DUSBD_USE_CDC

#
# TRIGORILLA PRO DISK BASED (STM32F103ZET6)
# Builds for Trigorilla to update from SD
#
[env:trigorilla_pro_disk]
extends = stm32_variant
board = genericSTM32F103ZE
board_build.crypt_chitu = update.zw
board_build.variant = MARLIN_F103Zx
board_build.offset = 0x8800
build_flags = ${stm32_variant.build_flags}
-DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5
build_unflags = ${stm32_variant.build_unflags}
-DUSBCON -DUSBD_USE_CDC
extra_scripts = ${stm32_variant.extra_scripts}
buildroot/share/PlatformIO/scripts/chitu_crypt.py


#
# Chitu boards like Tronxy X5s (STM32F103ZET6)
#
[env:chitu_f103]
extends = stm32_variant
board = genericSTM32F103ZE
board_build.crypt_chitu = update.cbd
board_build.variant = MARLIN_F103Zx
board_build.offset = 0x8800
build_flags = ${stm32_variant.build_flags}
Expand Down