Browse Source

🔨 Offset/encrypt/rename for Maple STM32F1 (#22477)

Tanguy Pruvot 2 years ago
parent
commit
5a72a39706
No account linked to committer's email address

+ 0
- 22
buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py View File

@@ -1,22 +0,0 @@
1
-#
2
-# buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py
3
-# Customizations for env:STM32F103VE_longer
4
-#
5
-import os,marlin
6
-
7
-# Rename ${PROGNAME}.bin and save it as 'project.bin' (No encryption on the Longer3D)
8
-def encrypt(source, target, env):
9
-    firmware = open(target[0].path, "rb")
10
-    renamed = open(target[0].dir.path + '/project.bin', "wb")
11
-    length = os.path.getsize(target[0].path)
12
-    position = 0
13
-    try:
14
-        while position < length:
15
-            byte = firmware.read(1)
16
-            renamed.write(byte)
17
-            position += 1
18
-    finally:
19
-        firmware.close()
20
-        renamed.close()
21
-
22
-marlin.add_post_action(encrypt);

+ 1
- 1
ini/stm32-common.ini View File

@@ -29,7 +29,7 @@ extra_scripts    = ${common.extra_scripts}
29 29
 extends       = common_stm32
30 30
 extra_scripts = ${common_stm32.extra_scripts}
31 31
                 pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
32
-                buildroot/share/PlatformIO/scripts/offset_and_rename.py
32
+                    buildroot/share/PlatformIO/scripts/offset_and_rename.py
33 33
 
34 34
 #
35 35
 # USB Flash Drive mix-ins for STM32

+ 2
- 1
ini/stm32f1-maple.ini View File

@@ -36,6 +36,7 @@ platform_packages = tool-stm32duino
36 36
 extra_scripts     = ${common.extra_scripts}
37 37
   pre:buildroot/share/PlatformIO/scripts/fix_framework_weakness.py
38 38
   pre:buildroot/share/PlatformIO/scripts/stm32_serialbuffer.py
39
+      buildroot/share/PlatformIO/scripts/offset_and_rename.py
39 40
 
40 41
 #
41 42
 # STM32F103RC
@@ -178,10 +179,10 @@ platform      = ${common_stm32f1.platform}
178 179
 extends       = common_stm32f1
179 180
 board         = genericSTM32F103VE
180 181
 board_build.address  = 0x08010000
182
+board_build.rename   = project.bin
181 183
 board_build.ldscript = STM32F103VE_longer.ld
182 184
 extra_scripts = ${common_stm32f1.extra_scripts}
183 185
   buildroot/share/PlatformIO/scripts/custom_board.py
184
-  buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py
185 186
 build_flags   = ${common_stm32f1.build_flags}
186 187
   -DMCU_STM32F103VE -DSTM32F1xx -USERIAL_USB -DU20 -DTS_V12
187 188
 build_unflags = ${common_stm32f1.build_unflags}

Loading…
Cancel
Save