diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 5a598299f3..93bda9726e 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -90,6 +90,7 @@ jobs: - NUCLEO_F767ZI - REMRAM_V1 - BTT_SKR_SE_BX + - chitu_f103 # Put lengthy tests last diff --git a/buildroot/share/PlatformIO/boards/LERDGE.json b/buildroot/share/PlatformIO/boards/LERDGE.json deleted file mode 100644 index 011814a133..0000000000 --- a/buildroot/share/PlatformIO/boards/LERDGE.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "build": { - "core": "stm32", - "cpu": "cortex-m4", - "extra_flags": "-DSTM32F407xx", - "f_cpu": "168000000L", - "hwids": [ - [ - "0x1EAF", - "0x0003" - ], - [ - "0x0483", - "0x3748" - ] - ], - "mcu": "stm32f407zgt6", - "variant": "LERDGE", - "ldscript": "LERDGE.ld" - }, - "debug": { - "jlink_device": "STM32F407ZG", - "openocd_target": "stm32f4x", - "svd_path": "STM32F40x.svd", - "tools": { - "stlink": { - "server": { - "arguments": [ - "-f", - "scripts/interface/stlink.cfg", - "-c", - "transport select hla_swd", - "-f", - "scripts/target/stm32f4x.cfg", - "-c", - "reset_config none" - ], - "executable": "bin/openocd", - "package": "tool-openocd" - } - } - } - }, - "frameworks": [ - "arduino", - "stm32cube" - ], - "name": "STM32F407ZGT6(192k RAM. 1024k Flash)", - "upload": { - "disable_flushing": false, - "maximum_ram_size": 196608, - "maximum_size": 1048576, - "protocol": "stlink", - "protocols": [ - "stlink", - "dfu", - "jlink" - ], - "require_upload_port": true, - "use_1200bps_touch": false, - "wait_for_upload_port": false - }, - "url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f407ZG.html", - "vendor": "Generic" -} diff --git a/buildroot/share/PlatformIO/boards/fysetc_f6.json b/buildroot/share/PlatformIO/boards/fysetc_f6.json deleted file mode 100644 index 2772f73a65..0000000000 --- a/buildroot/share/PlatformIO/boards/fysetc_f6.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "build": { - "core": "arduino", - "extra_flags": "-DARDUINO_AVR_MEGA2560", - "f_cpu": "16000000L", - "hwids": [ - [ - "0x27b2", - "0x0002" - ] - ], - "mcu": "atmega2560", - "variant": "fysetcf6" - }, - "debug": { - "simavr_target": "atmega2560", - "avr-stub": { - "speed": 115200 - } - }, - "frameworks": [ - "arduino" - ], - "name": "FYSETC F6", - "upload": { - "maximum_ram_size": 8192, - "maximum_size": 258048, - "protocol": "wiring", - "require_upload_port": true, - "speed": 115200 - }, - "url": "https://www.fysetc.com/", - "vendor": "FYSETC" -} diff --git a/buildroot/share/PlatformIO/boards/BTT_SKR_SE_BX.json b/buildroot/share/PlatformIO/boards/marlin_BTT_SKR_SE_BX.json similarity index 97% rename from buildroot/share/PlatformIO/boards/BTT_SKR_SE_BX.json rename to buildroot/share/PlatformIO/boards/marlin_BTT_SKR_SE_BX.json index 920b2478a9..65735d433b 100644 --- a/buildroot/share/PlatformIO/boards/BTT_SKR_SE_BX.json +++ b/buildroot/share/PlatformIO/boards/marlin_BTT_SKR_SE_BX.json @@ -5,7 +5,7 @@ "extra_flags": "-DSTM32H743xx", "f_cpu": "400000000L", "mcu": "stm32h743iit6", - "variant": "BTT_SKR_SE_BX" + "variant": "MARLIN_BTT_SKR_SE_BX" }, "debug": { "jlink_device": "STM32H743II", diff --git a/buildroot/share/PlatformIO/boards/BigTree_Btt002.json b/buildroot/share/PlatformIO/boards/marlin_BigTree_BTT002.json similarity index 96% rename from buildroot/share/PlatformIO/boards/BigTree_Btt002.json rename to buildroot/share/PlatformIO/boards/marlin_BigTree_BTT002.json index d0d092f1ea..28a79271b8 100644 --- a/buildroot/share/PlatformIO/boards/BigTree_Btt002.json +++ b/buildroot/share/PlatformIO/boards/marlin_BigTree_BTT002.json @@ -15,7 +15,7 @@ ] ], "mcu": "stm32f407vgt6", - "variant": "BIGTREE_BTT002" + "variant": "MARLIN_BIGTREE_BTT002" }, "debug": { "jlink_device": "STM32F407VG", diff --git a/buildroot/share/PlatformIO/boards/BigTree_GTR_v1.json b/buildroot/share/PlatformIO/boards/marlin_BigTree_GTR_v1.json similarity index 96% rename from buildroot/share/PlatformIO/boards/BigTree_GTR_v1.json rename to buildroot/share/PlatformIO/boards/marlin_BigTree_GTR_v1.json index 32236301c3..e311ce3b52 100644 --- a/buildroot/share/PlatformIO/boards/BigTree_GTR_v1.json +++ b/buildroot/share/PlatformIO/boards/marlin_BigTree_GTR_v1.json @@ -15,7 +15,7 @@ ] ], "mcu": "stm32f407zgt6", - "variant": "BIGTREE_GTR_V1" + "variant": "MARLIN_BIGTREE_GTR_V1" }, "debug": { "jlink_device": "STM32F407ZG", diff --git a/buildroot/share/PlatformIO/boards/BigTree_SKR_Pro.json b/buildroot/share/PlatformIO/boards/marlin_BigTree_SKR_Pro.json similarity index 95% rename from buildroot/share/PlatformIO/boards/BigTree_SKR_Pro.json rename to buildroot/share/PlatformIO/boards/marlin_BigTree_SKR_Pro.json index 211ceacdca..5e76c2c9e2 100644 --- a/buildroot/share/PlatformIO/boards/BigTree_SKR_Pro.json +++ b/buildroot/share/PlatformIO/boards/marlin_BigTree_SKR_Pro.json @@ -15,7 +15,7 @@ ] ], "mcu": "stm32f407zgt6", - "variant": "BIGTREE_SKR_PRO_1v1" + "variant": "MARLIN_BIGTREE_SKR_PRO_11" }, "debug": { "jlink_device": "STM32F407ZG", diff --git a/buildroot/share/PlatformIO/boards/CHITU_F103.json b/buildroot/share/PlatformIO/boards/marlin_CHITU_F103.json similarity index 93% rename from buildroot/share/PlatformIO/boards/CHITU_F103.json rename to buildroot/share/PlatformIO/boards/marlin_CHITU_F103.json index ecf7bff66c..dbfbc21cb2 100644 --- a/buildroot/share/PlatformIO/boards/CHITU_F103.json +++ b/buildroot/share/PlatformIO/boards/marlin_CHITU_F103.json @@ -15,8 +15,7 @@ ] ], "mcu": "stm32f103zet6", - "variant": "CHITU_F103", - "ldscript": "chitu_f103.ld" + "variant": "marlin_CHITU_F103" }, "debug": { "jlink_device": "STM32F103ZE", diff --git a/buildroot/share/PlatformIO/boards/FYSETC_CHEETAH_V20.json b/buildroot/share/PlatformIO/boards/marlin_FYSETC_CHEETAH_V20.json similarity index 96% rename from buildroot/share/PlatformIO/boards/FYSETC_CHEETAH_V20.json rename to buildroot/share/PlatformIO/boards/marlin_FYSETC_CHEETAH_V20.json index ff082fdc1f..e7b0d28afe 100644 --- a/buildroot/share/PlatformIO/boards/FYSETC_CHEETAH_V20.json +++ b/buildroot/share/PlatformIO/boards/marlin_FYSETC_CHEETAH_V20.json @@ -16,7 +16,7 @@ ], "ldscript": "stm32f401rc.ld", "mcu": "stm32f401rct6", - "variant": "FYSETC_CHEETAH_V20" + "variant": "MARLIN_FYSETC_CHEETAH_V20" }, "debug": { "jlink_device": "STM32F401RC", diff --git a/buildroot/share/PlatformIO/boards/MEEB_3DP.json b/buildroot/share/PlatformIO/boards/marlin_MEEB_3DP.json similarity index 97% rename from buildroot/share/PlatformIO/boards/MEEB_3DP.json rename to buildroot/share/PlatformIO/boards/marlin_MEEB_3DP.json index 870648b325..73ec9aaf48 100644 --- a/buildroot/share/PlatformIO/boards/MEEB_3DP.json +++ b/buildroot/share/PlatformIO/boards/marlin_MEEB_3DP.json @@ -18,7 +18,7 @@ "ldscript": "stm32f103xc.ld" }, "mcu": "stm32f103rct6", - "variant": "MEEB_3DP" + "variant": "marlin_MEEB_3DP" }, "debug": { "jlink_device": "STM32F103RC", diff --git a/buildroot/share/PlatformIO/boards/STEVAL_STM32F401VE.json b/buildroot/share/PlatformIO/boards/marlin_STEVAL_STM32F401VE.json similarity index 95% rename from buildroot/share/PlatformIO/boards/STEVAL_STM32F401VE.json rename to buildroot/share/PlatformIO/boards/marlin_STEVAL_STM32F401VE.json index bbfb3fdfa5..e89ca0af73 100644 --- a/buildroot/share/PlatformIO/boards/STEVAL_STM32F401VE.json +++ b/buildroot/share/PlatformIO/boards/marlin_STEVAL_STM32F401VE.json @@ -14,9 +14,8 @@ "0x3748" ] ], - "ldscript": "stm32f401xe.ld", "mcu": "stm32f401vet6", - "variant": "STEVAL_F401VE" + "variant": "MARLIN_STEVAL_F401VE" }, "debug": { "jlink_device": "STM32F401VE", diff --git a/buildroot/share/PlatformIO/boards/genericSTM32F407VGT6.json b/buildroot/share/PlatformIO/boards/marlin_STM32F407VGT6_CCM.json similarity index 100% rename from buildroot/share/PlatformIO/boards/genericSTM32F407VGT6.json rename to buildroot/share/PlatformIO/boards/marlin_STM32F407VGT6_CCM.json diff --git a/buildroot/share/PlatformIO/boards/FLYF407ZG.json b/buildroot/share/PlatformIO/boards/marlin_STM32F407ZGT6.json similarity index 94% rename from buildroot/share/PlatformIO/boards/FLYF407ZG.json rename to buildroot/share/PlatformIO/boards/marlin_STM32F407ZGT6.json index 7e585c5057..f6c78f8ab3 100644 --- a/buildroot/share/PlatformIO/boards/FLYF407ZG.json +++ b/buildroot/share/PlatformIO/boards/marlin_STM32F407ZGT6.json @@ -14,8 +14,7 @@ "0x3748" ] ], - "mcu": "stm32f407zgt6", - "variant": "FLY_F407ZG" + "mcu": "stm32f407zgt6" }, "debug": { "jlink_device": "STM32F407ZG", @@ -49,7 +48,7 @@ "disable_flushing": false, "maximum_ram_size": 196608, "maximum_size": 1048576, - "protocol": "dfu", + "protocol": "stlink", "protocols": [ "stlink", "dfu", diff --git a/buildroot/share/PlatformIO/boards/archim.json b/buildroot/share/PlatformIO/boards/marlin_archim.json similarity index 97% rename from buildroot/share/PlatformIO/boards/archim.json rename to buildroot/share/PlatformIO/boards/marlin_archim.json index 60035197f2..6d78c1f195 100644 --- a/buildroot/share/PlatformIO/boards/archim.json +++ b/buildroot/share/PlatformIO/boards/marlin_archim.json @@ -21,7 +21,7 @@ "ldscript": "linker_scripts/gcc/flash.ld", "mcu": "at91sam3x8e", "usb_product": "Archim", - "variant": "archim" + "variant": "MARLIN_ARCHIM" }, "connectivity": [ "can" diff --git a/buildroot/share/PlatformIO/boards/at90usb1286.json b/buildroot/share/PlatformIO/boards/marlin_at90usb1286.json similarity index 100% rename from buildroot/share/PlatformIO/boards/at90usb1286.json rename to buildroot/share/PlatformIO/boards/marlin_at90usb1286.json diff --git a/buildroot/share/PlatformIO/boards/blackSTM32F407VET6.json b/buildroot/share/PlatformIO/boards/marlin_blackSTM32F407VET6.json similarity index 100% rename from buildroot/share/PlatformIO/boards/blackSTM32F407VET6.json rename to buildroot/share/PlatformIO/boards/marlin_blackSTM32F407VET6.json diff --git a/buildroot/share/PlatformIO/boards/malyanM200.json b/buildroot/share/PlatformIO/boards/marlin_malyanM200.json similarity index 100% rename from buildroot/share/PlatformIO/boards/malyanM200.json rename to buildroot/share/PlatformIO/boards/marlin_malyanM200.json diff --git a/buildroot/share/PlatformIO/boards/malyanM200v2.json b/buildroot/share/PlatformIO/boards/marlin_malyanM200v2.json similarity index 100% rename from buildroot/share/PlatformIO/boards/malyanM200v2.json rename to buildroot/share/PlatformIO/boards/marlin_malyanM200v2.json diff --git a/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py b/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py index 6d7f21942e..03e121c435 100644 --- a/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py +++ b/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py @@ -1,5 +1,5 @@ # -# STM32F103RC_MEEB_3DP.py +# buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py # try: import configparser @@ -54,9 +54,5 @@ for define in env['CPPDEFINES']: print('Use the {0:s} address as the marlin app entry point.'.format(vect_tab_addr)) print('Use the {0:d}KB flash version of stm32f103rct6 chip.'.format(flash_size)) -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/STM32F103RC_MEEB_3DP.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script +import marlin +marlin.custom_ld_script("STM32F103RC_MEEB_3DP.ld") diff --git a/buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py b/buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py deleted file mode 100644 index 7e9dc676b6..0000000000 --- a/buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py +++ /dev/null @@ -1,23 +0,0 @@ -# -# STM32F103RC_SKR_MINI.py -# -import os -Import("env") - -STM32_FLASH_SIZE = 256 - -for define in env['CPPDEFINES']: - if define[0] == "VECT_TAB_ADDR": - env['CPPDEFINES'].remove(define) - if define[0] == "STM32_FLASH_SIZE": - STM32_FLASH_SIZE = define[1] - -# Relocate firmware from 0x08000000 to 0x08007000 -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI_" + str(STM32_FLASH_SIZE) + "K.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script diff --git a/buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py b/buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py index 1a7cc34edb..f64f928787 100644 --- a/buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py +++ b/buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py @@ -1,24 +1,11 @@ # -# STM32F103RC_fysetc.py +# buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py # import os from os.path import join from os.path import expandvars Import("env") -# Relocate firmware from 0x08000000 to 0x08008000 -#for define in env['CPPDEFINES']: -# if define[0] == "VECT_TAB_ADDR": -# env['CPPDEFINES'].remove(define) -#env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08008000")) - -#custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/fysetc_stm32f103rc.ld") -#for i, flag in enumerate(env["LINKFLAGS"]): -# if "-Wl,-T" in flag: -# env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script -# elif flag == "-T": -# env["LINKFLAGS"][i + 1] = custom_ld_script - # Custom HEX from ELF env.AddPostAction( join("$BUILD_DIR","${PROGNAME}.elf"), diff --git a/buildroot/share/PlatformIO/scripts/STM32F103RET6_creality.py b/buildroot/share/PlatformIO/scripts/STM32F103RET6_creality.py deleted file mode 100644 index e3ef98b03f..0000000000 --- a/buildroot/share/PlatformIO/scripts/STM32F103RET6_creality.py +++ /dev/null @@ -1,20 +0,0 @@ -# -# STM32F103RET6_creality.py -# -import os -Import("env") - -# Relocate firmware from 0x08000000 to 0x08007000 -for define in env['CPPDEFINES']: - if define[0] == "VECT_TAB_ADDR": - env['CPPDEFINES'].remove(define) - -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/creality.ld") - -for i, flag in enumerate(env['LINKFLAGS']): - if "-Wl,-T" in flag: - env['LINKFLAGS'][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env['LINKFLAGS'][i + 1] = custom_ld_script diff --git a/buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py b/buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py deleted file mode 100644 index 06e586f7f8..0000000000 --- a/buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py +++ /dev/null @@ -1,19 +0,0 @@ -# -# STM32F103RE_SKR_E3_DIP.py -# -import os -Import("env") - -for define in env['CPPDEFINES']: - if define[0] == "VECT_TAB_ADDR": - env['CPPDEFINES'].remove(define) - -# Relocate firmware from 0x08000000 to 0x08007000 -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/STM32F103RE_SKR_E3_DIP.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script diff --git a/buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py b/buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py index 321dd01b8d..c98059729f 100644 --- a/buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py +++ b/buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py @@ -1,36 +1,22 @@ # -# STM32F103VE_longer.py +# buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py # Customizations for env:STM32F103VE_longer # -import os -Import("env") - -# Relocate firmware from 0x08000000 to 0x08010000 -for define in env['CPPDEFINES']: - if define[0] == "VECT_TAB_ADDR": - env['CPPDEFINES'].remove(define) -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08010000")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/STM32F103VE_longer.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script +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") - marlin_alfa = open(target[0].dir.path +'/project.bin', "wb") + 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) - marlin_alfa.write(byte) + renamed.write(byte) position += 1 finally: firmware.close() - marlin_alfa.close() + renamed.close() -env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); +marlin.add_post_action(encrypt); diff --git a/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py b/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py index 91522a9d06..0a38e1ceee 100644 --- a/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py +++ b/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py @@ -1,19 +1,10 @@ # # STM32F1_create_variant.py # -import os,shutil +import os,shutil,marlin from SCons.Script import DefaultEnvironment from platformio import util -def copytree(src, dst, symlinks=False, ignore=None): - for item in os.listdir(src): - s = os.path.join(src, item) - d = os.path.join(dst, item) - if os.path.isdir(s): - shutil.copytree(s, d, symlinks, ignore) - else: - shutil.copy2(s, d) - env = DefaultEnvironment() platform = env.PioPlatform() board = env.BoardConfig() @@ -36,4 +27,4 @@ if os.path.isdir(variant_dir): if not os.path.isdir(variant_dir): os.mkdir(variant_dir) -copytree(source_dir, variant_dir) +marlin.copytree(source_dir, variant_dir) diff --git a/buildroot/share/PlatformIO/scripts/STM32F401VE_STEVAL.py b/buildroot/share/PlatformIO/scripts/STM32F401VE_STEVAL.py deleted file mode 100644 index ffd5bcd42d..0000000000 --- a/buildroot/share/PlatformIO/scripts/STM32F401VE_STEVAL.py +++ /dev/null @@ -1,13 +0,0 @@ -# -# STM32F401VE_STEVAL.py -# Customizations for env:STM32F401VE_STEVAL -# -import os -Import("env") - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/variants/STEVAL_F401VE/ldscript.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script diff --git a/buildroot/share/PlatformIO/scripts/chitu_crypt.py b/buildroot/share/PlatformIO/scripts/chitu_crypt.py index 3d4854b51f..23d81c1721 100644 --- a/buildroot/share/PlatformIO/scripts/chitu_crypt.py +++ b/buildroot/share/PlatformIO/scripts/chitu_crypt.py @@ -1,21 +1,11 @@ # -# chitu_crypt.py +# buildroot/share/PlatformIO/scripts/chitu_crypt.py # Customizations for Chitu boards # -Import("env") -import os,random,struct,uuid +import os,random,struct,uuid,marlin # Relocate firmware from 0x08000000 to 0x08008800 -env['CPPDEFINES'].remove(("VECT_TAB_ADDR", "0x8000000")) -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08008800")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/chitu_f103.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script - +marlin.relocate_firmware("0x08008800") def calculate_crc(contents, seed): accumulating_xor_value = seed; @@ -43,7 +33,7 @@ def xor_block(r0, r1, block_number, block_size, file_key): for loop_counter in range(0, block_size): # meant to make sure different bits of the key are used. - xor_seed = int(loop_counter/key_length) + xor_seed = int(loop_counter / key_length) # IP is a scratch register / R12 ip = loop_counter - (key_length * xor_seed) @@ -69,7 +59,6 @@ def xor_block(r0, r1, block_number, block_size, file_key): #increment the loop_counter loop_counter = loop_counter + 1 - def encrypt_file(input, output_file, file_length): input_file = bytearray(input.read()) block_size = 0x800 @@ -113,11 +102,10 @@ def encrypt_file(input, output_file, file_length): output_file.write(input_file) return - # Encrypt ${PROGNAME}.bin and save it as 'update.cbd' def encrypt(source, target, env): firmware = open(target[0].path, "rb") - update = open(target[0].dir.path +'/update.cbd', "wb") + update = open(target[0].dir.path + '/update.cbd', "wb") length = os.path.getsize(target[0].path) encrypt_file(firmware, update, length) @@ -125,4 +113,4 @@ def encrypt(source, target, env): firmware.close() update.close() -env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); +marlin.add_post_action(encrypt); diff --git a/buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py b/buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py deleted file mode 100644 index 15c953156c..0000000000 --- a/buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py +++ /dev/null @@ -1,49 +0,0 @@ -# -# copy_marlin_variant_to_framework.py -# -import os,shutil -from SCons.Script import DefaultEnvironment -from platformio import util -from platformio.package.meta import PackageSpec - -def copytree(src, dst, symlinks=False, ignore=None): - for item in os.listdir(src): - s = os.path.join(src, item) - d = os.path.join(dst, item) - if os.path.isdir(s): - shutil.copytree(s, d, symlinks, ignore) - else: - shutil.copy2(s, d) - -env = DefaultEnvironment() -platform = env.PioPlatform() -board = env.BoardConfig() -variant = board.get("build.variant") - -platform_packages = env.GetProjectOption('platform_packages') -# if there's no framework defined, take it from the class name of platform -framewords = { - "Ststm32Platform": "framework-arduinoststm32", - "AtmelavrPlatform": "framework-arduino-avr" -} -if len(platform_packages) == 0: - platform_name = framewords[platform.__class__.__name__] -else: - platform_name = PackageSpec(platform_packages[0]).name - -FRAMEWORK_DIR = platform.get_package_dir(platform_name) -assert os.path.isdir(FRAMEWORK_DIR) -assert os.path.isdir("buildroot/share/PlatformIO/variants") - -variant_dir = os.path.join(FRAMEWORK_DIR, "variants", variant) - -source_dir = os.path.join("buildroot/share/PlatformIO/variants", variant) -assert os.path.isdir(source_dir) - -if os.path.isdir(variant_dir): - shutil.rmtree(variant_dir) - -if not os.path.isdir(variant_dir): - os.mkdir(variant_dir) - -copytree(source_dir, variant_dir) diff --git a/buildroot/share/PlatformIO/scripts/custom_board.py b/buildroot/share/PlatformIO/scripts/custom_board.py new file mode 100644 index 0000000000..5d3ca3c652 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/custom_board.py @@ -0,0 +1,13 @@ +# +# buildroot/share/PlatformIO/scripts/custom_board.py +# +import marlin +board = marlin.env.BoardConfig() + +address = board.get("build.address", "") +if address: + marlin.relocate_firmware(address) + +ldscript = board.get("build.ldscript", "") +if ldscript: + marlin.custom_ld_script(ldscript) diff --git a/buildroot/share/PlatformIO/scripts/download_mks_assets.py b/buildroot/share/PlatformIO/scripts/download_mks_assets.py index 33acab9e12..e922fed2be 100644 --- a/buildroot/share/PlatformIO/scripts/download_mks_assets.py +++ b/buildroot/share/PlatformIO/scripts/download_mks_assets.py @@ -1,5 +1,6 @@ # -# download_mks_assets.py +# buildroot/share/PlatformIO/scripts/download_mks_assets.py +# Added by HAS_TFT_LVGL_UI to download assets from Makerbase repo # Import("env") import os,requests,zipfile,tempfile,shutil diff --git a/buildroot/share/PlatformIO/scripts/fly_mini.py b/buildroot/share/PlatformIO/scripts/fly_mini.py deleted file mode 100644 index 9c5df359ad..0000000000 --- a/buildroot/share/PlatformIO/scripts/fly_mini.py +++ /dev/null @@ -1,20 +0,0 @@ -# -# fly_mini.py -# Customizations for env:FLY_MINI -# -import os -Import("env") - -# Relocate firmware from 0x08000000 to 0x08005000 -for define in env['CPPDEFINES']: - if define[0] == "VECT_TAB_ADDR": - env['CPPDEFINES'].remove(define) -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08005000")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/fly_mini.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script - diff --git a/buildroot/share/PlatformIO/scripts/fysetc_cheetah_v20.py b/buildroot/share/PlatformIO/scripts/fysetc_cheetah_v20.py deleted file mode 100644 index f36d51f972..0000000000 --- a/buildroot/share/PlatformIO/scripts/fysetc_cheetah_v20.py +++ /dev/null @@ -1,13 +0,0 @@ -# -# STM32F401VE_STEVAL.py -# Customizations for env:STM32F401VE_STEVAL -# -import os -Import("env") - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/variants/FYSETC_CHEETAH_V20/ldscript.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script diff --git a/buildroot/share/PlatformIO/scripts/generic_create_variant.py b/buildroot/share/PlatformIO/scripts/generic_create_variant.py index aa79d39b51..3290dcea19 100644 --- a/buildroot/share/PlatformIO/scripts/generic_create_variant.py +++ b/buildroot/share/PlatformIO/scripts/generic_create_variant.py @@ -1,30 +1,54 @@ # -# Generate a generic variant +# generic_create_variant.py # -import os,shutil +# Copy one of the variants from buildroot/platformio/variants into +# the appropriate framework variants folder, so that its contents +# will be picked up by PlatformIO just like any other variant. +# +import os,shutil,marlin from SCons.Script import DefaultEnvironment from platformio import util env = DefaultEnvironment() + +# +# Get the platform name from the 'platform_packages' option, +# or look it up by the platform.class.name. +# platform = env.PioPlatform() -board = env.BoardConfig() -FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoststm32") +from platformio.package.meta import PackageSpec +platform_packages = env.GetProjectOption('platform_packages') +if len(platform_packages) == 0: + framewords = { + "Ststm32Platform": "framework-arduinoststm32", + "AtmelavrPlatform": "framework-arduino-avr" + } + platform_name = framewords[platform.__class__.__name__] +else: + platform_name = PackageSpec(platform_packages[0]).name + +if platform_name in [ "usb-host-msc", "usb-host-msc-cdc-msc", "tool-stm32duino" ]: + platform_name = "framework-arduinoststm32" + +FRAMEWORK_DIR = platform.get_package_dir(platform_name) assert os.path.isdir(FRAMEWORK_DIR) -assert os.path.isdir("buildroot/share/PlatformIO/variants") -mcu_type = board.get("build.mcu")[:-2] +board = env.BoardConfig() + +#mcu_type = board.get("build.mcu")[:-2] variant = board.get("build.variant") -series = mcu_type[:7].upper() + "xx" +#series = mcu_type[:7].upper() + "xx" + +# Prepare a new empty folder at the destination variant_dir = os.path.join(FRAMEWORK_DIR, "variants", variant) +if os.path.isdir(variant_dir): + shutil.rmtree(variant_dir) +if not os.path.isdir(variant_dir): + os.mkdir(variant_dir) +# Source dir is a local variant sub-folder source_dir = os.path.join("buildroot/share/PlatformIO/variants", variant) assert os.path.isdir(source_dir) -if not os.path.isdir(variant_dir): - os.mkdir(variant_dir) - -for file_name in os.listdir(source_dir): - full_file_name = os.path.join(source_dir, file_name) - if os.path.isfile(full_file_name): - shutil.copy(full_file_name, variant_dir) +marlin.copytree(source_dir, variant_dir) diff --git a/buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py b/buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py index 6c8a4f6034..a4001a240c 100644 --- a/buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py +++ b/buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py @@ -1,30 +1,21 @@ -import os -Import("env") +# +# buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py +# Customizations for env:jgaurora_a5s_a1 +# +import os,marlin -# Relocate firmware from 0x08000000 to 0x0800A000 -env['CPPDEFINES'].remove(("VECT_TAB_ADDR", "0x8000000")) -#alternatively, for STSTM <=5.1.0 use line below -#env['CPPDEFINES'].remove(("VECT_TAB_ADDR", 134217728)) -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x0800A000")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/jgaurora_a5s_a1.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script - -#append ${PROGNAME}.bin firmware after bootloader and save it as 'jgaurora_firmware.bin' -def addboot(source,target,env): +# Append ${PROGNAME}.bin firmware after bootloader and save it as 'jgaurora_firmware.bin' +def addboot(source, target, env): firmware = open(target[0].path, "rb") lengthfirmware = os.path.getsize(target[0].path) - bootloader_dir = "buildroot/share/PlatformIO/scripts/jgaurora_bootloader.bin" - bootloader = open(bootloader_dir, "rb") - lengthbootloader = os.path.getsize(bootloader_dir) - firmware_with_boothloader_dir = target[0].dir.path +'/firmware_with_bootloader.bin' - if os.path.exists(firmware_with_boothloader_dir): - os.remove(firmware_with_boothloader_dir) - firmwareimage = open(firmware_with_boothloader_dir, "wb") + bootloader_bin = "buildroot/share/PlatformIO/scripts/" + "jgaurora_bootloader.bin" + bootloader = open(bootloader_bin, "rb") + lengthbootloader = os.path.getsize(bootloader_bin) + + firmware_with_boothloader_bin = target[0].dir.path + '/firmware_with_bootloader.bin' + if os.path.exists(firmware_with_boothloader_bin): + os.remove(firmware_with_boothloader_bin) + firmwareimage = open(firmware_with_boothloader_bin, "wb") position = 0 while position < lengthbootloader: byte = bootloader.read(1) @@ -38,11 +29,11 @@ def addboot(source,target,env): bootloader.close() firmware.close() firmwareimage.close() - firmware_without_bootloader_dir = target[0].dir.path+'/firmware_for_sd_upload.bin' - if os.path.exists(firmware_without_bootloader_dir): - os.remove(firmware_without_bootloader_dir) - os.rename(target[0].path, firmware_without_bootloader_dir) - #os.rename(target[0].dir.path+'/firmware_with_bootloader.bin', target[0].dir.path+'/firmware.bin') -env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", addboot); + firmware_without_bootloader_bin = target[0].dir.path + '/firmware_for_sd_upload.bin' + if os.path.exists(firmware_without_bootloader_bin): + os.remove(firmware_without_bootloader_bin) + os.rename(target[0].path, firmware_without_bootloader_bin) + #os.rename(target[0].dir.path+'/firmware_with_bootloader.bin', target[0].dir.path+'/firmware.bin') +marlin.add_post_action(addboot); diff --git a/buildroot/share/PlatformIO/scripts/lerdge.py b/buildroot/share/PlatformIO/scripts/lerdge.py index ff4f5e446b..55f0a65ace 100644 --- a/buildroot/share/PlatformIO/scripts/lerdge.py +++ b/buildroot/share/PlatformIO/scripts/lerdge.py @@ -1,20 +1,16 @@ # -# lerdge.py -# Customizations for Lerdge build environments +# buildroot/share/PlatformIO/scripts/lerdge.py +# Customizations for Lerdge build environments: +# env:LERDGEX env:LERDGEX_usb_flash_drive +# env:LERDGES env:LERDGES_usb_flash_drive +# env:LERDGEK env:LERDGEK_usb_flash_drive # -import os,sys +import os,marlin Import("env") from SCons.Script import DefaultEnvironment board = DefaultEnvironment().BoardConfig() -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/lerdge.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script - def encryptByte(byte): byte = 0xFF & ((byte << 6) | (byte >> 2)) i = 0x58 + byte @@ -35,16 +31,16 @@ def encrypt_file(input, output_file, file_length): def encrypt(source, target, env): print("Encrypting to:", board.get("build.firmware")) firmware = open(target[0].path, "rb") - result = open(target[0].dir.path + "/" + board.get("build.firmware"), "wb") + renamed = open(target[0].dir.path + "/" + board.get("build.firmware"), "wb") length = os.path.getsize(target[0].path) - encrypt_file(firmware, result, length) + encrypt_file(firmware, renamed, length) firmware.close() - result.close() + renamed.close() if 'firmware' in board.get("build").keys(): - env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); + marlin.add_post_action(encrypt); else: print("You need to define output file via board_build.firmware = 'filename' parameter") exit(1); diff --git a/buildroot/share/PlatformIO/scripts/marlin.py b/buildroot/share/PlatformIO/scripts/marlin.py new file mode 100644 index 0000000000..d83ebceee2 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/marlin.py @@ -0,0 +1,75 @@ +# +# buildroot/share/PlatformIO/scripts/marlin.py +# Helper module with some commonly-used functions +# +import os,shutil + +from SCons.Script import DefaultEnvironment +env = DefaultEnvironment() + +def copytree(src, dst, symlinks=False, ignore=None): + for item in os.listdir(src): + s = os.path.join(src, item) + d = os.path.join(dst, item) + if os.path.isdir(s): + shutil.copytree(s, d, symlinks, ignore) + else: + shutil.copy2(s, d) + +def replace_define(field, value): + for define in env['CPPDEFINES']: + if define[0] == field: + env['CPPDEFINES'].remove(define) + env['CPPDEFINES'].append((field, value)) + +# Relocate the firmware to a new address, such as "0x08005000" +def relocate_firmware(address): + replace_define("VECT_TAB_ADDR", address) + +# Relocate the vector table with a new offset +def relocate_vtab(address): + replace_define("VECT_TAB_OFFSET", address) + +# Replace the existing -Wl,-T with the given ldscript path +def custom_ld_script(ldname): + apath = os.path.abspath("buildroot/share/PlatformIO/ldscripts/" + ldname) + for i, flag in enumerate(env["LINKFLAGS"]): + if "-Wl,-T" in flag: + env["LINKFLAGS"][i] = "-Wl,-T" + apath + elif flag == "-T": + env["LINKFLAGS"][i + 1] = apath + +# Encrypt ${PROGNAME}.bin and save it with a new name +# Called by specific encrypt() functions, mostly for MKS boards +def encrypt_mks(source, target, env, new_name): + import sys + + key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] + + firmware = open(target[0].path, "rb") + renamed = open(target[0].dir.path + "/" + new_name, "wb") + length = os.path.getsize(target[0].path) + position = 0 + try: + while position < length: + byte = firmware.read(1) + if position >= 320 and position < 31040: + byte = chr(ord(byte) ^ key[position & 31]) + if sys.version_info[0] > 2: + byte = bytes(byte, 'latin1') + renamed.write(byte) + position += 1 + finally: + firmware.close() + renamed.close() + +def add_post_action(action): + env.AddPostAction("$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); diff --git a/buildroot/share/PlatformIO/scripts/mks_encrypt.py b/buildroot/share/PlatformIO/scripts/mks_encrypt.py index 0d53cdfbe9..78d7cf349d 100644 --- a/buildroot/share/PlatformIO/scripts/mks_encrypt.py +++ b/buildroot/share/PlatformIO/scripts/mks_encrypt.py @@ -1,32 +1,28 @@ -import os,sys +# +# buildroot/share/PlatformIO/scripts/mks_encrypt.py +# +# Apply encryption and save as 'build.firmware' for these environments: +# - env:mks_robin_stm32 +# - env:flsun_hispeedv1 +# - env:mks_robin_nano35_stm32 +# Import("env") from SCons.Script import DefaultEnvironment board = DefaultEnvironment().BoardConfig() -# Encrypt ${PROGNAME}.bin and save it as build.firmware ('Robin.bin') -def encrypt(source, target, env): - key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] +if 'firmware' in board.get("build").keys(): - firmware = open(target[0].path, "rb") - robin = open(target[0].dir.path +'/'+ board.get("build.firmware"), "wb") - length = os.path.getsize(target[0].path) - position = 0 - try: - while position < length: - byte = firmware.read(1) - if position >= 320 and position < 31040: - byte = chr(ord(byte) ^ key[position & 31]) - if sys.version_info[0] > 2: - byte = bytes(byte, 'latin1') - robin.write(byte) - position += 1 - finally: - firmware.close() - robin.close() + import marlin + + # Encrypt ${PROGNAME}.bin and save it as build.firmware + def encrypt(source, target, env): + marlin.encrypt_mks(source, target, env, "build.firmware") + + marlin.add_post_action(encrypt); -if 'firmware' in board.get("build").keys(): - env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); else: - print("You need to define output file via board_build.firmware = 'filename' parameter", file=sys.stderr) - exit(1); + + import sys + print("You need to define output file via board_build.firmware = 'filename' parameter", file=sys.stderr) + env.Exit(1); diff --git a/buildroot/share/PlatformIO/scripts/mks_robin.py b/buildroot/share/PlatformIO/scripts/mks_robin.py index dd2342bf0d..8c5e4ae276 100644 --- a/buildroot/share/PlatformIO/scripts/mks_robin.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin.py @@ -1,39 +1,5 @@ -import os -Import("env") - -# Relocate firmware from 0x08000000 to 0x08007000 -for define in env['CPPDEFINES']: - if define[0] == "VECT_TAB_ADDR": - env['CPPDEFINES'].remove(define) -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script - -# Encrypt ${PROGNAME}.bin and save it as 'Robin.bin' -def encrypt(source, target, env): - import sys - - key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] - - firmware = open(target[0].path, "rb") - robin = open(target[0].dir.path +'/Robin.bin', "wb") - length = os.path.getsize(target[0].path) - position = 0 - try: - while position < length: - byte = firmware.read(1) - if position >= 320 and position < 31040: - byte = chr(ord(byte) ^ key[position & 31]) - if sys.version_info[0] > 2: - byte = bytes(byte, 'latin1') - robin.write(byte) - position += 1 - finally: - firmware.close() - robin.close() -env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); +# +# buildroot/share/PlatformIO/scripts/mks_robin.py +# +import marlin +marlin.prepare_robin("0x08007000", "mks_robin.ld", "Robin.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_e3.py b/buildroot/share/PlatformIO/scripts/mks_robin_e3.py index 3af623cce0..7f6f538d6a 100644 --- a/buildroot/share/PlatformIO/scripts/mks_robin_e3.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin_e3.py @@ -1,40 +1,5 @@ -import os -Import("env") - -# Relocate firmware from 0x08000000 to 0x08005000 -for define in env['CPPDEFINES']: - if define[0] == "VECT_TAB_ADDR": - env['CPPDEFINES'].remove(define) -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08005000")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_e3.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script - - -# Encrypt ${PROGNAME}.bin and save it as 'mksLite.bin' -def encrypt(source, target, env): - import sys - - key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] - - firmware = open(target[0].path, "rb") - robin = open(target[0].dir.path +'/Robin_e3.bin', "wb") - length = os.path.getsize(target[0].path) - position = 0 - try: - while position < length: - byte = firmware.read(1) - if position >= 320 and position < 31040: - byte = chr(ord(byte) ^ key[position & 31]) - if sys.version_info[0] > 2: - byte = bytes(byte, 'latin1') - robin.write(byte) - position += 1 - finally: - firmware.close() - robin.close() -env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); +# +# buildroot/share/PlatformIO/scripts/mks_robin_e3.py +# +import marlin +marlin.prepare_robin("0x08005000", "mks_robin_e3.ld", "Robin_e3.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_e3p.py b/buildroot/share/PlatformIO/scripts/mks_robin_e3p.py index 2aab14bab7..1f3cacf873 100644 --- a/buildroot/share/PlatformIO/scripts/mks_robin_e3p.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin_e3p.py @@ -1,40 +1,5 @@ -import os -Import("env") - -# Relocate firmware from 0x08000000 to 0x08007000 -for define in env['CPPDEFINES']: - if define[0] == "VECT_TAB_ADDR": - env['CPPDEFINES'].remove(define) -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_e3p.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script - - -# Encrypt ${PROGNAME}.bin and save it as 'mks_robin_e3p.bin' -def encrypt(source, target, env): - import sys - - key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] - - firmware = open(target[0].path, "rb") - robin = open(target[0].dir.path +'/Robin_e3p.bin', "wb") - length = os.path.getsize(target[0].path) - position = 0 - try: - while position < length: - byte = firmware.read(1) - if position >= 320 and position < 31040: - byte = chr(ord(byte) ^ key[position & 31]) - if sys.version_info[0] > 2: - byte = bytes(byte, 'latin1') - robin.write(byte) - position += 1 - finally: - firmware.close() - robin.close() -env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); +# +# buildroot/share/PlatformIO/scripts/mks_robin_e3p.py +# +import marlin +marlin.prepare_robin("0x08007000", "mks_robin_e3p.ld", "Robin_e3p.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_lite.py b/buildroot/share/PlatformIO/scripts/mks_robin_lite.py index 2f3ae1fa9a..b8c039ada8 100644 --- a/buildroot/share/PlatformIO/scripts/mks_robin_lite.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin_lite.py @@ -1,40 +1,5 @@ -import os -Import("env") - -# Relocate firmware from 0x08000000 to 0x08005000 -for define in env['CPPDEFINES']: - if define[0] == "VECT_TAB_ADDR": - env['CPPDEFINES'].remove(define) -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08005000")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_lite.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script - - -# Encrypt ${PROGNAME}.bin and save it as 'mksLite.bin' -def encrypt(source, target, env): - import sys - - key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] - - firmware = open(target[0].path, "rb") - robin = open(target[0].dir.path +'/mksLite.bin', "wb") - length = os.path.getsize(target[0].path) - position = 0 - try: - while position < length: - byte = firmware.read(1) - if position >= 320 and position < 31040: - byte = chr(ord(byte) ^ key[position & 31]) - if sys.version_info[0] > 2: - byte = bytes(byte, 'latin1') - robin.write(byte) - position += 1 - finally: - firmware.close() - robin.close() -env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); +# +# buildroot/share/PlatformIO/scripts/mks_robin_lite.py +# +import marlin +marlin.prepare_robin("0x08005000", "mks_robin_lite.ld", "mksLite.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_lite3.py b/buildroot/share/PlatformIO/scripts/mks_robin_lite3.py index 67ad442d82..bea8b80ace 100644 --- a/buildroot/share/PlatformIO/scripts/mks_robin_lite3.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin_lite3.py @@ -1,40 +1,5 @@ -import os -Import("env") - -# Relocate firmware from 0x08000000 to 0x08005000 -for define in env['CPPDEFINES']: - if define[0] == "VECT_TAB_ADDR": - env['CPPDEFINES'].remove(define) -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08005000")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_lite.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script - - -# Encrypt ${PROGNAME}.bin and save it as 'mksLite.bin' -def encrypt(source, target, env): - import sys - - key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] - - firmware = open(target[0].path, "rb") - robin = open(target[0].dir.path +'/mksLite3.bin', "wb") - length = os.path.getsize(target[0].path) - position = 0 - try: - while position < length: - byte = firmware.read(1) - if position >= 320 and position < 31040: - byte = chr(ord(byte) ^ key[position & 31]) - if sys.version_info[0] > 2: - byte = bytes(byte, 'latin1') - robin.write(byte) - position += 1 - finally: - firmware.close() - robin.close() -env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); +# +# buildroot/share/PlatformIO/scripts/mks_robin_lite3.py +# +import marlin +marlin.prepare_robin("0x08005000", "mks_robin_lite.ld", "mksLite3.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_mini.py b/buildroot/share/PlatformIO/scripts/mks_robin_mini.py index d386698301..4c52035965 100644 --- a/buildroot/share/PlatformIO/scripts/mks_robin_mini.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin_mini.py @@ -1,40 +1,5 @@ -import os -Import("env") - -# Relocate firmware from 0x08000000 to 0x08007000 -for define in env['CPPDEFINES']: - if define[0] == "VECT_TAB_ADDR": - env['CPPDEFINES'].remove(define) -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_mini.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script - - -# Encrypt ${PROGNAME}.bin and save it as 'Robin_mini.bin' -def encrypt(source, target, env): - import sys - - key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] - - firmware = open(target[0].path, "rb") - robin = open(target[0].dir.path +'/Robin_mini.bin', "wb") - length = os.path.getsize(target[0].path) - position = 0 - try: - while position < length: - byte = firmware.read(1) - if position >= 320 and position < 31040: - byte = chr(ord(byte) ^ key[position & 31]) - if sys.version_info[0] > 2: - byte = bytes(byte, 'latin1') - robin.write(byte) - position += 1 - finally: - firmware.close() - robin.close() -env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); +# +# buildroot/share/PlatformIO/scripts/mks_robin_mini.py +# +import marlin +marlin.prepare_robin("0x08005000", "mks_robin_mini.ld", "Robin_mini.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_nano.py b/buildroot/share/PlatformIO/scripts/mks_robin_nano.py index a68fd308d4..319b4d4982 100644 --- a/buildroot/share/PlatformIO/scripts/mks_robin_nano.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin_nano.py @@ -1,40 +1,5 @@ -import os -Import("env") - -# Relocate firmware from 0x08000000 to 0x08007000 -for define in env['CPPDEFINES']: - if define[0] == "VECT_TAB_ADDR": - env['CPPDEFINES'].remove(define) -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_nano.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script - - -# Encrypt ${PROGNAME}.bin and save it as 'Robin_nano.bin' -def encrypt(source, target, env): - import sys - - key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] - - firmware = open(target[0].path, "rb") - robin = open(target[0].dir.path +'/Robin_nano.bin', "wb") - length = os.path.getsize(target[0].path) - position = 0 - try: - while position < length: - byte = firmware.read(1) - if position >= 320 and position < 31040: - byte = chr(ord(byte) ^ key[position & 31]) - if sys.version_info[0] > 2: - byte = bytes(byte, 'latin1') - robin.write(byte) - position += 1 - finally: - firmware.close() - robin.close() -env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); +# +# buildroot/share/PlatformIO/scripts/mks_robin_nano.py +# +import marlin +marlin.prepare_robin("0x08007000", "mks_robin_nano.ld", "Robin_nano.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_nano35.py b/buildroot/share/PlatformIO/scripts/mks_robin_nano35.py index 0047289adf..310c3d6606 100644 --- a/buildroot/share/PlatformIO/scripts/mks_robin_nano35.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin_nano35.py @@ -1,40 +1,5 @@ -import os -Import("env") - -# Relocate firmware from 0x08000000 to 0x08007000 -for define in env['CPPDEFINES']: - if define[0] == "VECT_TAB_ADDR": - env['CPPDEFINES'].remove(define) -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_nano.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script - - -# Encrypt ${PROGNAME}.bin and save it as 'Robin_nano35.bin' -def encrypt(source, target, env): - import sys - - key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] - - firmware = open(target[0].path, "rb") - robin = open(target[0].dir.path +'/Robin_nano35.bin', "wb") - length = os.path.getsize(target[0].path) - position = 0 - try: - while position < length: - byte = firmware.read(1) - if position >= 320 and position < 31040: - byte = chr(ord(byte) ^ key[position & 31]) - if sys.version_info[0] > 2: - byte = bytes(byte, 'latin1') - robin.write(byte) - position += 1 - finally: - firmware.close() - robin.close() -env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); +# +# buildroot/share/PlatformIO/scripts/mks_robin_nano35.py +# +import marlin +marlin.prepare_robin("0x08007000", "mks_robin_nano.ld", "Robin_nano35.bin") diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_pro.py b/buildroot/share/PlatformIO/scripts/mks_robin_pro.py index 2ebf1ffb9d..c624663a33 100644 --- a/buildroot/share/PlatformIO/scripts/mks_robin_pro.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin_pro.py @@ -1,39 +1,5 @@ -import os -Import("env") - -# Relocate firmware from 0x08000000 to 0x08007000 -for define in env['CPPDEFINES']: - if define[0] == "VECT_TAB_ADDR": - env['CPPDEFINES'].remove(define) -env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000")) - -custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/mks_robin_pro.ld") -for i, flag in enumerate(env["LINKFLAGS"]): - if "-Wl,-T" in flag: - env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script - elif flag == "-T": - env["LINKFLAGS"][i + 1] = custom_ld_script - -# Encrypt ${PROGNAME}.bin and save it as 'Robin.bin' -def encrypt(source, target, env): - import sys - - key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] - - firmware = open(target[0].path, "rb") - robin = open(target[0].dir.path +'/Robin_pro.bin', "wb") - length = os.path.getsize(target[0].path) - position = 0 - try: - while position < length: - byte = firmware.read(1) - if position >= 320 and position < 31040: - byte = chr(ord(byte) ^ key[position & 31]) - if sys.version_info[0] > 2: - byte = bytes(byte, 'latin1') - robin.write(byte) - position += 1 - finally: - firmware.close() - robin.close() -env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt); +# +# buildroot/share/PlatformIO/scripts/mks_robin_pro.py +# +import marlin +marlin.prepare_robin("0x08007000", "mks_robin_pro.ld", "Robin_pro.bin") diff --git a/buildroot/share/PlatformIO/scripts/stm32_bootloader.py b/buildroot/share/PlatformIO/scripts/stm32_bootloader.py index 1ceff84b8f..4e7d2d9c07 100644 --- a/buildroot/share/PlatformIO/scripts/stm32_bootloader.py +++ b/buildroot/share/PlatformIO/scripts/stm32_bootloader.py @@ -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) diff --git a/buildroot/share/PlatformIO/variants/archim/.gitignore b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/.gitignore similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/.gitignore rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/.gitignore diff --git a/buildroot/share/PlatformIO/variants/archim/build_gcc/Makefile b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/build_gcc/Makefile similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/build_gcc/Makefile rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/build_gcc/Makefile diff --git a/buildroot/share/PlatformIO/variants/archim/build_gcc/debug.mk b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/build_gcc/debug.mk similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/build_gcc/debug.mk rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/build_gcc/debug.mk diff --git a/buildroot/share/PlatformIO/variants/archim/build_gcc/gcc.mk b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/build_gcc/gcc.mk similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/build_gcc/gcc.mk rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/build_gcc/gcc.mk diff --git a/buildroot/share/PlatformIO/variants/archim/build_gcc/libvariant_arduino_due_x.mk b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/build_gcc/libvariant_arduino_due_x.mk similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/build_gcc/libvariant_arduino_due_x.mk rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/build_gcc/libvariant_arduino_due_x.mk diff --git a/buildroot/share/PlatformIO/variants/archim/build_gcc/release.mk b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/build_gcc/release.mk similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/build_gcc/release.mk rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/build_gcc/release.mk diff --git a/buildroot/share/PlatformIO/variants/archim/debug_scripts/gcc/arduino_due_x_flash.gdb b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/debug_scripts/gcc/arduino_due_x_flash.gdb similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/debug_scripts/gcc/arduino_due_x_flash.gdb rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/debug_scripts/gcc/arduino_due_x_flash.gdb diff --git a/buildroot/share/PlatformIO/variants/archim/debug_scripts/gcc/arduino_due_x_sram.gdb b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/debug_scripts/gcc/arduino_due_x_sram.gdb similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/debug_scripts/gcc/arduino_due_x_sram.gdb rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/debug_scripts/gcc/arduino_due_x_sram.gdb diff --git a/buildroot/share/PlatformIO/variants/archim/debug_scripts/iar/arduino_due_flash.mac b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/debug_scripts/iar/arduino_due_flash.mac similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/debug_scripts/iar/arduino_due_flash.mac rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/debug_scripts/iar/arduino_due_flash.mac diff --git a/buildroot/share/PlatformIO/variants/archim/debug_scripts/iar/arduino_due_sram.mac b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/debug_scripts/iar/arduino_due_sram.mac similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/debug_scripts/iar/arduino_due_sram.mac rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/debug_scripts/iar/arduino_due_sram.mac diff --git a/buildroot/share/PlatformIO/variants/archim/libsam_sam3x8e_gcc_rel.a b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/libsam_sam3x8e_gcc_rel.a similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/libsam_sam3x8e_gcc_rel.a rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/libsam_sam3x8e_gcc_rel.a diff --git a/buildroot/share/PlatformIO/variants/archim/libsam_sam3x8e_gcc_rel.a.txt b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/libsam_sam3x8e_gcc_rel.a.txt similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/libsam_sam3x8e_gcc_rel.a.txt rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/libsam_sam3x8e_gcc_rel.a.txt diff --git a/buildroot/share/PlatformIO/variants/archim/linker_scripts/gcc/flash.ld b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/linker_scripts/gcc/flash.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/linker_scripts/gcc/flash.ld rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/linker_scripts/gcc/flash.ld diff --git a/buildroot/share/PlatformIO/variants/archim/linker_scripts/gcc/sram.ld b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/linker_scripts/gcc/sram.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/linker_scripts/gcc/sram.ld rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/linker_scripts/gcc/sram.ld diff --git a/buildroot/share/PlatformIO/variants/archim/linker_scripts/iar/flash.icf b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/linker_scripts/iar/flash.icf similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/linker_scripts/iar/flash.icf rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/linker_scripts/iar/flash.icf diff --git a/buildroot/share/PlatformIO/variants/archim/linker_scripts/iar/sram.icf b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/linker_scripts/iar/sram.icf similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/linker_scripts/iar/sram.icf rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/linker_scripts/iar/sram.icf diff --git a/buildroot/share/PlatformIO/variants/archim/pins_arduino.h b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/pins_arduino.h similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/pins_arduino.h rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/pins_arduino.h diff --git a/buildroot/share/PlatformIO/variants/archim/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/variant.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/variant.cpp diff --git a/buildroot/share/PlatformIO/variants/archim/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/variant.h similarity index 100% rename from buildroot/share/PlatformIO/variants/archim/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_ARCHIM/variant.h diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/PeripheralPins.c similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PeripheralPins.c rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/PeripheralPins.c diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/PinNamesVar.h similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_BTT002/PinNamesVar.h rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/PinNamesVar.h diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/hal_conf_extra.h similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_BTT002/hal_conf_extra.h rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/hal_conf_extra.h diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/ldscript.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_BTT002/ldscript.ld rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/ldscript.ld diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/variant.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_BTT002/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/variant.cpp diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_BTT002/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/variant.h similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_BTT002/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/variant.h diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_E3_RRF/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/PeripheralPins.c similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_E3_RRF/PeripheralPins.c rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/PeripheralPins.c diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_E3_RRF/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/PinNamesVar.h similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_E3_RRF/PinNamesVar.h rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/PinNamesVar.h diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_E3_RRF/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/hal_conf_extra.h similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_E3_RRF/hal_conf_extra.h rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/hal_conf_extra.h diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_E3_RRF/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/ldscript.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_E3_RRF/ldscript.ld rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/ldscript.ld diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_E3_RRF/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/variant.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_E3_RRF/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/variant.cpp diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_E3_RRF/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/variant.h similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_E3_RRF/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/variant.h diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/PeripheralPins.c similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/PeripheralPins.c rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/PeripheralPins.c diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/PinNamesVar.h similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/PinNamesVar.h rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/PinNamesVar.h diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/hal_conf_extra.h similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/hal_conf_extra.h rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/hal_conf_extra.h diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/ldscript.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/ldscript.ld rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/ldscript.ld diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/variant.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/variant.cpp diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/variant.h similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_GTR_V1/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/variant.h diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/PeripheralPins.c similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PeripheralPins.c rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/PeripheralPins.c diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/PinNamesVar.h similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PinNamesVar.h rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/PinNamesVar.h diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/hal_conf_extra.h similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/hal_conf_extra.h rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/hal_conf_extra.h diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/ldscript.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/ldscript.ld rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/ldscript.ld diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/variant.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/variant.cpp diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/variant.h similarity index 100% rename from buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/variant.h diff --git a/buildroot/share/PlatformIO/variants/BTT_SKR_SE_BX/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/PeripheralPins.c similarity index 100% rename from buildroot/share/PlatformIO/variants/BTT_SKR_SE_BX/PeripheralPins.c rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/PeripheralPins.c diff --git a/buildroot/share/PlatformIO/variants/BTT_SKR_SE_BX/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/PinNamesVar.h similarity index 100% rename from buildroot/share/PlatformIO/variants/BTT_SKR_SE_BX/PinNamesVar.h rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/PinNamesVar.h diff --git a/buildroot/share/PlatformIO/variants/BTT_SKR_SE_BX/hal_conf_extra.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/hal_conf_extra.h similarity index 100% rename from buildroot/share/PlatformIO/variants/BTT_SKR_SE_BX/hal_conf_extra.h rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/hal_conf_extra.h diff --git a/buildroot/share/PlatformIO/variants/BTT_SKR_SE_BX/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/ldscript.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/BTT_SKR_SE_BX/ldscript.ld rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/ldscript.ld diff --git a/buildroot/share/PlatformIO/variants/BTT_SKR_SE_BX/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/BTT_SKR_SE_BX/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.cpp diff --git a/buildroot/share/PlatformIO/variants/BTT_SKR_SE_BX/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.h similarity index 100% rename from buildroot/share/PlatformIO/variants/BTT_SKR_SE_BX/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.h diff --git a/buildroot/share/PlatformIO/variants/FLY_F407ZG/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/PeripheralPins.c similarity index 100% rename from buildroot/share/PlatformIO/variants/FLY_F407ZG/PeripheralPins.c rename to buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/PeripheralPins.c diff --git a/buildroot/share/PlatformIO/variants/FLY_F407ZG/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/PinNamesVar.h similarity index 100% rename from buildroot/share/PlatformIO/variants/FLY_F407ZG/PinNamesVar.h rename to buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/PinNamesVar.h diff --git a/buildroot/share/PlatformIO/variants/FLY_F407ZG/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/ldscript.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/FLY_F407ZG/ldscript.ld rename to buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/ldscript.ld diff --git a/buildroot/share/PlatformIO/variants/FLY_F407ZG/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/FLY_F407ZG/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.cpp diff --git a/buildroot/share/PlatformIO/variants/FLY_F407ZG/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.h similarity index 100% rename from buildroot/share/PlatformIO/variants/FLY_F407ZG/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.h diff --git a/buildroot/share/PlatformIO/variants/FYSETC_CHEETAH_V20/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/PeripheralPins.c similarity index 100% rename from buildroot/share/PlatformIO/variants/FYSETC_CHEETAH_V20/PeripheralPins.c rename to buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/PeripheralPins.c diff --git a/buildroot/share/PlatformIO/variants/FYSETC_CHEETAH_V20/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/PinNamesVar.h similarity index 100% rename from buildroot/share/PlatformIO/variants/FYSETC_CHEETAH_V20/PinNamesVar.h rename to buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/PinNamesVar.h diff --git a/buildroot/share/PlatformIO/variants/FYSETC_CHEETAH_V20/hal_conf_custom.h b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/hal_conf_custom.h similarity index 100% rename from buildroot/share/PlatformIO/variants/FYSETC_CHEETAH_V20/hal_conf_custom.h rename to buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/hal_conf_custom.h diff --git a/buildroot/share/PlatformIO/variants/FYSETC_CHEETAH_V20/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/ldscript.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/FYSETC_CHEETAH_V20/ldscript.ld rename to buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/ldscript.ld diff --git a/buildroot/share/PlatformIO/variants/FYSETC_CHEETAH_V20/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/variant.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/FYSETC_CHEETAH_V20/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/variant.cpp diff --git a/buildroot/share/PlatformIO/variants/FYSETC_CHEETAH_V20/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/variant.h similarity index 100% rename from buildroot/share/PlatformIO/variants/FYSETC_CHEETAH_V20/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/variant.h diff --git a/buildroot/share/PlatformIO/variants/LERDGE/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/PeripheralPins.c similarity index 100% rename from buildroot/share/PlatformIO/variants/LERDGE/PeripheralPins.c rename to buildroot/share/PlatformIO/variants/MARLIN_LERDGE/PeripheralPins.c diff --git a/buildroot/share/PlatformIO/variants/LERDGE/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/PinNamesVar.h similarity index 100% rename from buildroot/share/PlatformIO/variants/LERDGE/PinNamesVar.h rename to buildroot/share/PlatformIO/variants/MARLIN_LERDGE/PinNamesVar.h diff --git a/buildroot/share/PlatformIO/ldscripts/lerdge.ld b/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/ldscript.ld similarity index 100% rename from buildroot/share/PlatformIO/ldscripts/lerdge.ld rename to buildroot/share/PlatformIO/variants/MARLIN_LERDGE/ldscript.ld diff --git a/buildroot/share/PlatformIO/variants/LERDGE/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/LERDGE/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.cpp diff --git a/buildroot/share/PlatformIO/variants/LERDGE/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h similarity index 100% rename from buildroot/share/PlatformIO/variants/LERDGE/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h diff --git a/buildroot/share/PlatformIO/variants/megaextendedpins/pins_arduino.h b/buildroot/share/PlatformIO/variants/MARLIN_MEGA_EXTENDED/pins_arduino.h similarity index 100% rename from buildroot/share/PlatformIO/variants/megaextendedpins/pins_arduino.h rename to buildroot/share/PlatformIO/variants/MARLIN_MEGA_EXTENDED/pins_arduino.h diff --git a/buildroot/share/PlatformIO/variants/STEVAL_F401VE/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/PeripheralPins.c similarity index 100% rename from buildroot/share/PlatformIO/variants/STEVAL_F401VE/PeripheralPins.c rename to buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/PeripheralPins.c diff --git a/buildroot/share/PlatformIO/variants/STEVAL_F401VE/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/PinNamesVar.h similarity index 100% rename from buildroot/share/PlatformIO/variants/STEVAL_F401VE/PinNamesVar.h rename to buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/PinNamesVar.h diff --git a/buildroot/share/PlatformIO/variants/STEVAL_F401VE/hal_conf_custom.h b/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/hal_conf_custom.h similarity index 100% rename from buildroot/share/PlatformIO/variants/STEVAL_F401VE/hal_conf_custom.h rename to buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/hal_conf_custom.h diff --git a/buildroot/share/PlatformIO/variants/STEVAL_F401VE/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/ldscript.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/STEVAL_F401VE/ldscript.ld rename to buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/ldscript.ld diff --git a/buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/variant.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/variant.cpp diff --git a/buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/variant.h similarity index 100% rename from buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/variant.h diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/board.cpp b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/board.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/board.cpp rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/board.cpp diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/board/board.h b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/board/board.h similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/board/board.h rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/board/board.h diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/ld/common.inc b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/common.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/ld/common.inc rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/common.inc diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/ld/extra_libs.inc b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/extra_libs.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/ld/extra_libs.inc rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/extra_libs.inc diff --git a/buildroot/share/PlatformIO/ldscripts/chitu_f103.ld b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/flash.ld similarity index 100% rename from buildroot/share/PlatformIO/ldscripts/chitu_f103.ld rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/flash.ld diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103z_dfu.ld b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103z_dfu.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103z_dfu.ld rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103z_dfu.ld diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103zc.ld b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103zc.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103zc.ld rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103zc.ld diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103zd.ld b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103zd.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103zd.ld rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103zd.ld diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103ze.ld b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103ze.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/ld/stm32f103ze.ld rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/stm32f103ze.ld diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/ld/vector_symbols.inc b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/vector_symbols.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/ld/vector_symbols.inc rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/ld/vector_symbols.inc diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/pins_arduino.h b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/pins_arduino.h similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/pins_arduino.h rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/pins_arduino.h diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/variant.h b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/variant.h similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/variant.h rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/variant.h diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/boards.cpp b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/boards.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/wirish/boards.cpp rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/boards.cpp diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/boards_setup.cpp b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/boards_setup.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/wirish/boards_setup.cpp rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/boards_setup.cpp diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/start.S b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/start.S similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/wirish/start.S rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/start.S diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/start_c.c b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/start_c.c similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/wirish/start_c.c rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/start_c.c diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/wirish/syscalls.c b/buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/syscalls.c similarity index 100% rename from buildroot/share/PlatformIO/variants/CHITU_F103/wirish/syscalls.c rename to buildroot/share/PlatformIO/variants/marlin_CHITU_F103/wirish/syscalls.c diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/board.cpp b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/board.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/board.cpp rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/board.cpp diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/board/board.h b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/board/board.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/board/board.h rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/board/board.h diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/bootloader.ld b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/bootloader.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/ld/bootloader.ld rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/bootloader.ld diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/common.inc b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/common.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/ld/common.inc rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/common.inc diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/extra_libs.inc b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/extra_libs.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/ld/extra_libs.inc rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/extra_libs.inc diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/flash.ld b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/flash.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/ld/flash.ld rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/flash.ld diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/jtag.ld b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/jtag.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/ld/jtag.ld rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/jtag.ld diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-flash.inc b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/mem-flash.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-flash.inc rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/mem-flash.inc diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-jtag.inc b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/mem-jtag.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-jtag.inc rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/mem-jtag.inc diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-ram.inc b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/mem-ram.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/ld/mem-ram.inc rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/mem-ram.inc diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/ram.ld b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/ram.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/ld/ram.ld rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/ram.ld diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rb.ld b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rb.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rb.ld rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rb.ld diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rb_bootloader.ld b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rb_bootloader.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rb_bootloader.ld rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rb_bootloader.ld diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rc.ld b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rc.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rc.ld rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rc.ld diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rc_bootloader.ld b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rc_bootloader.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103rc_bootloader.ld rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103rc_bootloader.ld diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103re.ld b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103re.ld similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/ld/stm32f103re.ld rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/stm32f103re.ld diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/ld/vector_symbols.inc b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/vector_symbols.inc similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/ld/vector_symbols.inc rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/ld/vector_symbols.inc diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/pins_arduino.h b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/pins_arduino.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/pins_arduino.h rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/pins_arduino.h diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/variant.h b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/variant.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/variant.h rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/variant.h diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/boards.cpp b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/boards.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/boards.cpp rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/boards.cpp diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/boards_setup.cpp b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/boards_setup.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/boards_setup.cpp rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/boards_setup.cpp diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/start.S b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/start.S similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/start.S rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/start.S diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/start_c.c b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/start_c.c similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/start_c.c rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/start_c.c diff --git a/buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/syscalls.c b/buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/syscalls.c similarity index 100% rename from buildroot/share/PlatformIO/variants/MEEB_3DP/wirish/syscalls.c rename to buildroot/share/PlatformIO/variants/marlin_MEEB_3DP/wirish/syscalls.c diff --git a/buildroot/tests/chitu_f103 b/buildroot/tests/chitu_f103 new file mode 100755 index 0000000000..139c480e3e --- /dev/null +++ b/buildroot/tests/chitu_f103 @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# Build tests for chitu_f103 (STM32F103ZE) +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +use_example_configs Tronxy/X5SA +exec_test $1 $2 "Tronxy/X5SA" "$3" + +# clean up +restore_configs diff --git a/ini/avr.ini b/ini/avr.ini index 1b208400a3..cd10f13499 100644 --- a/ini/avr.ini +++ b/ini/avr.ini @@ -35,9 +35,9 @@ board = megaatmega2560 [env:mega2560ext] platform = atmelavr extends = env:mega2560 -board_build.variant = megaextendedpins +board_build.variant = MARLIN_MEGA_EXTENDED extra_scripts = ${common.extra_scripts} - pre:buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py + pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py # # ATmega1280 @@ -52,9 +52,9 @@ board = megaatmega1280 # [mega_extended_optimized] extends = common_avr8 -board_build.variant = megaextendedpins +board_build.variant = MARLIN_MEGA_EXTENDED extra_scripts = ${common.extra_scripts} - pre:buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py + pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py upload_speed = 57600 build_flags = ${common.build_flags} -fno-tree-scev-cprop -fno-split-wide-types -Wl,--relax -mcall-prologues @@ -88,7 +88,7 @@ board = reprap_rambo [env:FYSETC_F6] platform = atmelavr extends = common_avr8 -board = fysetc_f6 +board = fysetc_f6_13 # # Sanguinololu (ATmega644p) @@ -161,7 +161,7 @@ build_flags = ${tuned_1284p.build_flags} [env:at90usb1286_cdc] platform = teensy extends = common_avr8 -board = at90usb1286 +board = marlin_at90usb1286 lib_ignore = ${env:common_avr8.lib_ignore}, Teensy_ADC, NativeEthernet # diff --git a/ini/due.ini b/ini/due.ini index 7abc262eb4..9123af8cdc 100644 --- a/ini/due.ini +++ b/ini/due.ini @@ -31,7 +31,7 @@ board = dueUSB [common_DUE_archim] platform = atmelsam extends = env:DUE -board = archim +board = marlin_archim build_flags = ${common.build_flags} -DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__ -DUSBCON board_build.variants_dir = buildroot/share/PlatformIO/variants/ diff --git a/ini/stm32f0.ini b/ini/stm32f0.ini index 10ac21fc89..64568e4b4c 100644 --- a/ini/stm32f0.ini +++ b/ini/stm32f0.ini @@ -25,7 +25,7 @@ [env:STM32F070RB_malyan] platform = ${common_stm32.platform} extends = common_stm32 -board = malyanM200v2 +board = marlin_malyanM200v2 build_flags = ${common_stm32.build_flags} -DHAL_PCD_MODULE_ENABLED -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing -DCUSTOM_STARTUP_FILE diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index a2954e64cf..94693d65a4 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -65,7 +65,7 @@ monitor_speed = 115200 [env:STM32F103RC_meeb] platform = ${common_stm32f1.platform} extends = common_stm32f1 -board = MEEB_3DP +board = marlin_MEEB_3DP build_flags = ${common_stm32f1.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4 @@ -114,8 +114,10 @@ upload_protocol = serial [env:STM32F103RC_btt] platform = ${common_stm32f1.platform} extends = env:STM32F103RC +board_build.address = 0x08007000 +board_build.ldscript = STM32F103RC_SKR_MINI_256K.ld extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py + buildroot/share/PlatformIO/scripts/custom_board.py build_flags = ${common_stm32f1.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4 monitor_speed = 115200 @@ -130,6 +132,7 @@ lib_deps = ${env:STM32F103RC_btt.lib_deps} [env:STM32F103RC_btt_512K] platform = ${common_stm32f1.platform} extends = env:STM32F103RC_btt +board_build.ldscript = STM32F103RC_SKR_MINI_512K.ld board_upload.maximum_size=524288 build_flags = ${env:STM32F103RC_btt.build_flags} -DSTM32_FLASH_SIZE=512 @@ -156,8 +159,10 @@ monitor_speed = 115200 [env:STM32F103RE_btt] platform = ${common_stm32f1.platform} extends = env:STM32F103RE +board_build.address = 0x08007000 +board_build.ldscript = STM32F103RE_SKR_E3_DIP.ld extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py + buildroot/share/PlatformIO/scripts/custom_board.py build_flags = ${common_stm32f1.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4 debug_tool = stlink upload_protocol = stlink @@ -190,7 +195,10 @@ upload_protocol = serial platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103VE +board_build.address = 0x08010000 +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 @@ -330,7 +338,10 @@ extra_scripts = ${common_stm32f1.extra_scripts} platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103ZE +board_build.address = 0x0800A000 +board_build.ldscript = jgaurora_a5s_a1.ld extra_scripts = ${common_stm32f1.extra_scripts} + buildroot/share/PlatformIO/scripts/custom_board.py buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py build_flags = ${common_stm32f1.build_flags} -DSTM32F1xx -DSTM32_XL_DENSITY @@ -341,7 +352,7 @@ build_flags = ${common_stm32f1.build_flags} [env:STM32F103CB_malyan] platform = ${common_stm32f1.platform} extends = common_stm32f1 -board = malyanM200 +board = marlin_malyanM200 build_flags = ${common_stm32f1.build_flags} -DMCU_STM32F103CB -D__STM32F1__=1 -std=c++1y -DSERIAL_USB -ffunction-sections -fdata-sections -Wl,--gc-sections -DDEBUG_LEVEL=0 -D__MARLIN_FIRMWARE__ @@ -354,7 +365,7 @@ lib_ignore = ${common_stm32f1.lib_ignore} [env:chitu_f103] platform = ${common_stm32f1.platform} extends = common_stm32f1 -board = CHITU_F103 +board = marlin_CHITU_F103 extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-dependencies.py pre:buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py buildroot/share/PlatformIO/scripts/chitu_crypt.py @@ -379,9 +390,11 @@ build_flags = ${env:chitu_f103.build_flags} -DCHITU_V5_Z_MIN_BUGFIX platform = ${env:STM32F103RE.platform} extends = env:STM32F103RE build_flags = ${env:STM32F103RE.build_flags} -DTEMP_TIMER_CHAN=4 +board_build.address = 0x08007000 +board_build.ldscript = creality.ld extra_scripts = ${env:STM32F103RE.extra_scripts} pre:buildroot/share/PlatformIO/scripts/random-bin.py - buildroot/share/PlatformIO/scripts/STM32F103RET6_creality.py + buildroot/share/PlatformIO/scripts/custom_board.py debug_tool = jlink upload_protocol = jlink diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 1678b26d89..d6418f439e 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -36,13 +36,12 @@ build_flags = ${common_stm32.build_flags} [env:STM32F401VE_STEVAL] platform = ${common_stm32.platform} extends = common_stm32 -board = STEVAL_STM32F401VE +board = marlin_STEVAL_STM32F401VE build_flags = ${common_stm32.build_flags} -DARDUINO_STEVAL -DSTM32F401xE -DDISABLE_GENERIC_SERIALUSB -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py - buildroot/share/PlatformIO/scripts/STM32F401VE_STEVAL.py # # STM32F401RC @@ -50,38 +49,41 @@ extra_scripts = ${common.extra_scripts} [env:FYSETC_CHEETAH_V20] platform = ${common_stm32.platform} extends = common_stm32 -board = FYSETC_CHEETAH_V20 +board = marlin_FYSETC_CHEETAH_V20 build_flags = ${common_stm32.build_flags} -DSTM32F401xC -DVECT_TAB_OFFSET=0xC000 extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py - buildroot/share/PlatformIO/scripts/FYSETC_CHEETAH_V20.py # # FLYF407ZG # [env:FLYF407ZG] -platform = ${common_stm32.platform} -extends = common_stm32 -board = FLYF407ZG -build_flags = ${common_stm32.build_flags} +platform = ${common_stm32.platform} +extends = common_stm32 +board = marlin_STM32F407ZGT6 +board_build.variant = MARLIN_FLY_F407ZG +upload_protocol = dfu +build_flags = ${common_stm32.build_flags} -DVECT_TAB_OFFSET=0x8000 -extra_scripts = ${common.extra_scripts} +extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py # -# FLY MINI(stm32f103rct6) +# FLY MINI (STM32F103RCT6) # [env:FLY_MINI] platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103RC +board_build.address = 0x08005000 +board_build.ldscript = fly_mini.ld extra_scripts = ${common_stm32f1.extra_scripts} - buildroot/share/PlatformIO/scripts/fly_mini.py + buildroot/share/PlatformIO/scripts/custom_board.py build_flags = ${common_stm32f1.build_flags} - -DDEBUG_LEVEL=0 -DSS_TIMER=4 + -DDEBUG_LEVEL=0 -DSS_TIMER=4 # -# FYSETC S6 (STM32F446VET6 ARM Cortex-M4) +# FYSETC S6 (STM32F446RET6 ARM Cortex-M4) # [env:FYSETC_S6] platform = ${common_stm32.platform} @@ -105,7 +107,7 @@ upload_command = dfu-util -a 0 -s 0x08010000:leave -D "$SOURCE" [env:STM32F407VE_black] platform = ${common_stm32.platform} extends = common_stm32 -board = blackSTM32F407VET6 +board = marlin_blackSTM32F407VET6 build_flags = ${common_stm32.build_flags} -DARDUINO_BLACK_F407VE -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS @@ -121,7 +123,7 @@ extra_scripts = ${common.extra_scripts} platform = ${common_stm32.platform} extends = common_stm32 build_flags = ${common_stm32.build_flags} -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED -board = genericSTM32F407VGT6 +board = marlin_STM32F407VGT6_CCM board_build.core = stm32 board_build.variant = MARLIN_F4x7Vx board_build.ldscript = ldscript.ld @@ -144,7 +146,7 @@ extra_scripts = ${common.extra_scripts} [env:BIGTREE_SKR_PRO] platform = ${common_stm32.platform} extends = common_stm32 -board = BigTree_SKR_Pro +board = marlin_BigTree_SKR_Pro build_flags = ${common_stm32.build_flags} -DSTM32F407_5ZX -DVECT_TAB_OFFSET=0x8000 extra_scripts = ${common.extra_scripts} @@ -180,7 +182,7 @@ build_flags = ${stm_flash_drive.build_flags} platform = ${common_stm32.platform} extends = common_stm32 board = genericSTM32F407VGT6 -board_build.variant = BIGTREE_E3_RRF +board_build.variant = MARLIN_BIGTREE_E3_RRF build_flags = ${common_stm32.build_flags} -DSTM32F407_5VX -DVECT_TAB_OFFSET=0x8000 -DSERIAL_RX_BUFFER_SIZE=255 -DSERIAL_TX_BUFFER_SIZE=255 @@ -193,7 +195,7 @@ extra_scripts = ${common.extra_scripts} [env:BIGTREE_GTR_V1_0] platform = ${common_stm32.platform} extends = common_stm32 -board = BigTree_GTR_v1 +board = marlin_BigTree_GTR_v1 extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py build_flags = ${common_stm32.build_flags} @@ -215,7 +217,7 @@ build_flags = ${stm_flash_drive.build_flags} [env:BIGTREE_BTT002] platform = ${common_stm32.platform} extends = common_stm32 -board = BigTree_Btt002 +board = marlin_BigTree_BTT002 build_flags = ${common_stm32.build_flags} -DSTM32F407_5VX -DVECT_TAB_OFFSET=0x8000 -DHAVE_HWSERIAL2 @@ -251,11 +253,12 @@ build_flags = ${stm_flash_drive.build_flags} [lerdge_common] platform = ${common_stm32.platform} extends = common_stm32 -board = LERDGE +board = marlin_STM32F407ZGT6 +board_build.variant = MARLIN_LERDGE board_build.offset = 0x10000 board_build.encrypt = Yes extra_scripts = ${common.extra_scripts} - pre:buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py + pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py buildroot/share/PlatformIO/scripts/stm32_bootloader.py buildroot/share/PlatformIO/scripts/lerdge.py build_flags = ${common_stm32.build_flags} @@ -377,7 +380,7 @@ build_flags = -DPIN_WIRE_SCL=PB6 -DPIN_WIRE_SDA=PB7 platform = ${common_stm32.platform} extends = common_stm32 build_flags = ${common_stm32.build_flags} ${stm32f4_I2C1.build_flags} -DHAL_PCD_MODULE_ENABLED -DUSBCON -DUSBD_USE_CDC -board = genericSTM32F407VGT6 +board = marlin_STM32F407VGT6_CCM board_build.core = stm32 board_build.variant = MARLIN_F4x7Vx board_build.ldscript = ldscript.ld diff --git a/ini/stm32f7.ini b/ini/stm32f7.ini index afcfc102d5..76d039533c 100644 --- a/ini/stm32f7.ini +++ b/ini/stm32f7.ini @@ -46,7 +46,7 @@ build_flags = ${common_stm32.build_flags} platform = ${common_stm32.platform} platform_packages = ${stm_flash_drive.platform_packages} extends = common_stm32 -board = BTT_SKR_SE_BX +board = marlin_BTT_SKR_SE_BX extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py build_flags = ${common_stm32.build_flags}