Browse Source

🔨 Trigorilla Pro disk based update (#24591)

J.C. Nelson 1 year ago
parent
commit
7f10f8932e
3 changed files with 35 additions and 5 deletions
  1. 1
    1
      Marlin/src/pins/pins.h
  2. 15
    4
      buildroot/share/PlatformIO/scripts/chitu_crypt.py
  3. 19
    0
      ini/stm32f1.ini

+ 1
- 1
Marlin/src/pins/pins.h View File

@@ -590,7 +590,7 @@
590 590
 #elif MB(CREALITY_V25S1)
591 591
   #include "stm32f1/pins_CREALITY_V25S1.h"      // STM32F1                                env:STM32F103RE_creality_smartPro env:STM32F103RE_creality_smartPro_maple
592 592
 #elif MB(TRIGORILLA_PRO)
593
-  #include "stm32f1/pins_TRIGORILLA_PRO.h"      // STM32F1                                env:trigorilla_pro env:trigorilla_pro_maple
593
+  #include "stm32f1/pins_TRIGORILLA_PRO.h"      // STM32F1                                env:trigorilla_pro env:trigorilla_pro_maple env:trigorilla_pro_disk
594 594
 #elif MB(FLY_MINI)
595 595
   #include "stm32f1/pins_FLY_MINI.h"            // STM32F1                                env:FLY_MINI env:FLY_MINI_maple
596 596
 #elif MB(FLSUN_HISPEED)

+ 15
- 4
buildroot/share/PlatformIO/scripts/chitu_crypt.py View File

@@ -4,7 +4,9 @@
4 4
 #
5 5
 import pioutil
6 6
 if pioutil.is_pio_build():
7
-	import struct,uuid
7
+	import struct,uuid,marlin
8
+
9
+	board = marlin.env.BoardConfig()
8 10
 
9 11
 	def calculate_crc(contents, seed):
10 12
 		accumulating_xor_value = seed;
@@ -104,12 +106,21 @@ if pioutil.is_pio_build():
104 106
 	# Encrypt ${PROGNAME}.bin and save it as 'update.cbd'
105 107
 	def encrypt(source, target, env):
106 108
 		from pathlib import Path
109
+
107 110
 		fwpath = Path(target[0].path)
108 111
 		fwsize = fwpath.stat().st_size
112
+
113
+		enname = board.get("build.crypt_chitu")
114
+		enpath = Path(target[0].dir.path)
115
+
109 116
 		fwfile = fwpath.open("rb")
110
-		upfile = Path(target[0].dir.path, 'update.cbd').open("wb")
111
-		encrypt_file(fwfile, upfile, fwsize)
117
+		enfile = (enpath / enname).open("wb")
118
+
119
+		print(f"Encrypting {fwpath} to {enname}")
120
+		encrypt_file(fwfile, enfile, fwsize)
121
+		fwfile.close()
122
+		enfile.close()
123
+		fwpath.unlink()
112 124
 
113
-	import marlin
114 125
 	marlin.relocate_firmware("0x08008800")
115 126
 	marlin.add_post_action(encrypt);

+ 19
- 0
ini/stm32f1.ini View File

@@ -379,11 +379,30 @@ build_unflags        = ${stm32_variant.build_unflags}
379 379
                        -DUSBCON -DUSBD_USE_CDC
380 380
 
381 381
 #
382
+# TRIGORILLA PRO DISK BASED (STM32F103ZET6)
383
+# Builds for Trigorilla to update from SD
384
+#
385
+[env:trigorilla_pro_disk]
386
+extends              = stm32_variant
387
+board                = genericSTM32F103ZE
388
+board_build.crypt_chitu = update.zw
389
+board_build.variant  = MARLIN_F103Zx
390
+board_build.offset   = 0x8800
391
+build_flags          = ${stm32_variant.build_flags}
392
+                       -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5
393
+build_unflags        = ${stm32_variant.build_unflags}
394
+                       -DUSBCON -DUSBD_USE_CDC
395
+extra_scripts        = ${stm32_variant.extra_scripts}
396
+                       buildroot/share/PlatformIO/scripts/chitu_crypt.py
397
+
398
+
399
+#
382 400
 # Chitu boards like Tronxy X5s (STM32F103ZET6)
383 401
 #
384 402
 [env:chitu_f103]
385 403
 extends              = stm32_variant
386 404
 board                = genericSTM32F103ZE
405
+board_build.crypt_chitu = update.cbd
387 406
 board_build.variant  = MARLIN_F103Zx
388 407
 board_build.offset   = 0x8800
389 408
 build_flags          = ${stm32_variant.build_flags}

Loading…
Cancel
Save