Browse Source

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

vanilla_fb_2.0.x
Tanguy Pruvot 3 years ago
committed by Scott Lahteine
parent
commit
eeac85642f
  1. 22
      buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py
  2. 2
      ini/stm32-common.ini
  3. 3
      ini/stm32f1-maple.ini

22
buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py

@ -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);

2
ini/stm32-common.ini

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

3
ini/stm32f1-maple.ini

@ -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}

Loading…
Cancel
Save