mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-07-07 06:57:27 -06:00
Rename, clean up boards/variants (#21655)
* Consolidate variant scripts * Rename Marlin-local boards * Simplify variants where possible * Rename variants * CHITU_F103 and MEEB_3DP: Maple platform `platformio-build-stm32f1.py` uses the 'board' name, not 'board_build.variant' so folder names match 'board' and not `board_build.variant`.
This commit is contained in:
parent
69d85cce2d
commit
ee016e605c
167 changed files with 340 additions and 840 deletions
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# stm32_bootloader.py
|
||||
#
|
||||
import os,sys,shutil
|
||||
import os,sys,shutil,marlin
|
||||
Import("env")
|
||||
|
||||
from SCons.Script import DefaultEnvironment
|
||||
|
@ -11,35 +11,30 @@ board = DefaultEnvironment().BoardConfig()
|
|||
# Copy the firmware.bin file to build.firmware, no encryption
|
||||
#
|
||||
def noencrypt(source, target, env):
|
||||
firmware = os.path.join(target[0].dir.path, board.get("build.firmware"))
|
||||
shutil.copy(target[0].path, firmware)
|
||||
firmware = os.path.join(target[0].dir.path, board.get("build.firmware"))
|
||||
shutil.copy(target[0].path, firmware)
|
||||
|
||||
#
|
||||
# For build.offset define LD_FLASH_OFFSET, used by ldscript.ld
|
||||
#
|
||||
if 'offset' in board.get("build").keys():
|
||||
LD_FLASH_OFFSET = board.get("build.offset")
|
||||
LD_FLASH_OFFSET = board.get("build.offset")
|
||||
|
||||
# Remove an existing VECT_TAB_OFFSET from CPPDEFINES
|
||||
for define in env['CPPDEFINES']:
|
||||
if define[0] == "VECT_TAB_OFFSET":
|
||||
env['CPPDEFINES'].remove(define)
|
||||
marlin.relocate_vtab(LD_FLASH_OFFSET)
|
||||
|
||||
# Replace VECT_TAB_OFFSET with our LD_FLASH_OFFSET
|
||||
env['CPPDEFINES'].append(("VECT_TAB_OFFSET", LD_FLASH_OFFSET))
|
||||
# Get upload.maximum_ram_size (defined by /buildroot/share/PlatformIO/boards/VARIOUS.json)
|
||||
maximum_ram_size = board.get("upload.maximum_ram_size")
|
||||
|
||||
# Get upload.maximum_ram_size (defined by /buildroot/share/PlatformIO/boards/VARIOUS.json)
|
||||
maximum_ram_size = board.get("upload.maximum_ram_size")
|
||||
|
||||
for i, flag in enumerate(env["LINKFLAGS"]):
|
||||
if "-Wl,--defsym=LD_FLASH_OFFSET" in flag:
|
||||
env["LINKFLAGS"][i] = "-Wl,--defsym=LD_FLASH_OFFSET=" + LD_FLASH_OFFSET
|
||||
if "-Wl,--defsym=LD_MAX_DATA_SIZE" in flag:
|
||||
env["LINKFLAGS"][i] = "-Wl,--defsym=LD_MAX_DATA_SIZE=" + str(maximum_ram_size - 40)
|
||||
for i, flag in enumerate(env["LINKFLAGS"]):
|
||||
if "-Wl,--defsym=LD_FLASH_OFFSET" in flag:
|
||||
env["LINKFLAGS"][i] = "-Wl,--defsym=LD_FLASH_OFFSET=" + LD_FLASH_OFFSET
|
||||
if "-Wl,--defsym=LD_MAX_DATA_SIZE" in flag:
|
||||
env["LINKFLAGS"][i] = "-Wl,--defsym=LD_MAX_DATA_SIZE=" + str(maximum_ram_size - 40)
|
||||
|
||||
#
|
||||
# Only copy the file if there's no encrypt
|
||||
#
|
||||
board_keys = board.get("build").keys()
|
||||
if 'firmware' in board_keys and not 'encrypt' in board_keys:
|
||||
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", noencrypt)
|
||||
import marlin
|
||||
marlin.add_post_action(noencrypt)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue