🔨 Clean up build scripts (#22264)

* Add 10K to marlin_blackSTM32F407VET6 (typo?)
* Document custom build scripts.
* Add a Robin common build script.
* Extraneous .ldscript specifiers
This commit is contained in:
Scott Lahteine
2021-06-29 16:25:37 -05:00
committed by Scott Lahteine
parent e213246ab9
commit 6d191d12c9
16 changed files with 41 additions and 39 deletions

View File

@ -1,6 +1,9 @@
#
# buildroot/share/PlatformIO/scripts/custom_board.py
#
# - For build.address replace VECT_TAB_ADDR to relocate the firmware
# - For build.ldscript use one of the linker scripts in buildroot/share/PlatformIO/ldscripts
#
import marlin
board = marlin.env.BoardConfig()

View File

@ -67,11 +67,3 @@ def encrypt_mks(source, target, env, new_name):
def add_post_action(action):
env.AddPostAction(join("$BUILD_DIR", "${PROGNAME}.bin"), action);
# Apply customizations for a MKS Robin
def prepare_robin(address, ldname, fwname):
def encrypt(source, target, env):
encrypt_mks(source, target, env, fwname)
relocate_firmware(address)
custom_ld_script(ldname)
add_post_action(encrypt);

View File

@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin.py
#
import marlin
marlin.prepare_robin("0x08007000", "mks_robin.ld", "Robin.bin")
import robin
robin.prepare("0x08007000", "mks_robin.ld", "Robin.bin")

View File

@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_e3.py
#
import marlin
marlin.prepare_robin("0x08005000", "mks_robin_e3.ld", "Robin_e3.bin")
import robin
robin.prepare("0x08005000", "mks_robin_e3.ld", "Robin_e3.bin")

View File

@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_e3p.py
#
import marlin
marlin.prepare_robin("0x08007000", "mks_robin_e3p.ld", "Robin_e3p.bin")
import robin
robin.prepare("0x08007000", "mks_robin_e3p.ld", "Robin_e3p.bin")

View File

@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_lite.py
#
import marlin
marlin.prepare_robin("0x08005000", "mks_robin_lite.ld", "mksLite.bin")
import robin
robin.prepare("0x08005000", "mks_robin_lite.ld", "mksLite.bin")

View File

@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_lite3.py
#
import marlin
marlin.prepare_robin("0x08005000", "mks_robin_lite.ld", "mksLite3.bin")
import robin
robin.prepare("0x08005000", "mks_robin_lite.ld", "mksLite3.bin")

View File

@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_mini.py
#
import marlin
marlin.prepare_robin("0x08007000", "mks_robin_mini.ld", "Robin_mini.bin")
import robin
robin.prepare("0x08007000", "mks_robin_mini.ld", "Robin_mini.bin")

View File

@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_nano.py
#
import marlin
marlin.prepare_robin("0x08007000", "mks_robin_nano.ld", "Robin_nano.bin")
import robin
robin.prepare("0x08007000", "mks_robin_nano.ld", "Robin_nano.bin")

View File

@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_nano35.py
#
import marlin
marlin.prepare_robin("0x08007000", "mks_robin_nano.ld", "Robin_nano35.bin")
import robin
robin.prepare("0x08007000", "mks_robin_nano.ld", "Robin_nano35.bin")

View File

@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_pro.py
#
import marlin
marlin.prepare_robin("0x08007000", "mks_robin_pro.ld", "Robin_pro.bin")
import robin
robin.prepare("0x08007000", "mks_robin_pro.ld", "Robin_pro.bin")

View File

@ -0,0 +1,12 @@
#
# buildroot/share/PlatformIO/scripts/robin.py
#
import marlin
# Apply customizations for a MKS Robin
def prepare(address, ldname, fwname):
def encrypt(source, target, env):
marlin.encrypt_mks(source, target, env, fwname)
marlin.relocate_firmware(address)
marlin.custom_ld_script(ldname)
marlin.add_post_action(encrypt);

View File

@ -1,6 +1,13 @@
#
# stm32_bootloader.py
#
# - If 'build.offset' is provided, either by JSON or by the environment...
# - Set linker flag LD_FLASH_OFFSET and relocate the VTAB based on 'build.offset'.
# - Set linker flag LD_MAX_DATA_SIZE based on 'build.maximum_ram_size'.
# - Define STM32_FLASH_SIZE from 'upload.maximum_size' for use by Flash-based EEPROM emulation.
#
# - For 'board_build.rename' add a post-action to rename the firmware file.
#
import os,sys,marlin
Import("env")