1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-27 05:48:43 +00:00

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

This commit is contained in:
Tanguy Pruvot 2021-08-01 21:43:31 +02:00 committed by GitHub
parent 1e33c1a2a7
commit 5a72a39706
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 24 deletions

View File

@ -1,22 +0,0 @@
#
# buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py
# Customizations for env:STM32F103VE_longer
#
import os,marlin
# Rename ${PROGNAME}.bin and save it as 'project.bin' (No encryption on the Longer3D)
def encrypt(source, target, env):
firmware = open(target[0].path, "rb")
renamed = open(target[0].dir.path + '/project.bin', "wb")
length = os.path.getsize(target[0].path)
position = 0
try:
while position < length:
byte = firmware.read(1)
renamed.write(byte)
position += 1
finally:
firmware.close()
renamed.close()
marlin.add_post_action(encrypt);

View File

@ -36,6 +36,7 @@ platform_packages = tool-stm32duino
extra_scripts = ${common.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/fix_framework_weakness.py
pre:buildroot/share/PlatformIO/scripts/stm32_serialbuffer.py
buildroot/share/PlatformIO/scripts/offset_and_rename.py
#
# STM32F103RC
@ -178,10 +179,10 @@ platform = ${common_stm32f1.platform}
extends = common_stm32f1
board = genericSTM32F103VE
board_build.address = 0x08010000
board_build.rename = project.bin
board_build.ldscript = STM32F103VE_longer.ld
extra_scripts = ${common_stm32f1.extra_scripts}
buildroot/share/PlatformIO/scripts/custom_board.py
buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py
build_flags = ${common_stm32f1.build_flags}
-DMCU_STM32F103VE -DSTM32F1xx -USERIAL_USB -DU20 -DTS_V12
build_unflags = ${common_stm32f1.build_unflags}