-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cfb973a
commit 887e30a
Showing
23 changed files
with
219 additions
and
544 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 8 additions & 14 deletions
22
buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,17 @@ | ||
# | ||
# STM32F103RC_SKR_MINI.py | ||
# buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py | ||
# Customizations for env:STM32F103RC_btt | ||
# | ||
import os | ||
import marlin | ||
Import("env") | ||
|
||
STM32_FLASH_SIZE = 256 | ||
# Relocate firmware from 0x08000000 to 0x08007000 | ||
marlin.relocate_firmware("0x08007000") | ||
|
||
# Use STM32_FLASH_SIZE to choose a linker script | ||
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 | ||
marlin.custom_ld_script("STM32F103RC_SKR_MINI_" + str(STM32_FLASH_SIZE) + "K.ld") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 4 additions & 15 deletions
19
buildroot/share/PlatformIO/scripts/STM32F103RET6_creality.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,9 @@ | ||
# | ||
# STM32F103RET6_creality.py | ||
# buildroot/share/PlatformIO/scripts/STM32F103RET6_creality.py | ||
# | ||
import os | ||
Import("env") | ||
import marlin | ||
|
||
# Relocate firmware from 0x08000000 to 0x08007000 | ||
for define in env['CPPDEFINES']: | ||
if define[0] == "VECT_TAB_ADDR": | ||
env['CPPDEFINES'].remove(define) | ||
marlin.relocate_firmware("0x08007000") | ||
|
||
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 | ||
marlin.custom_ld_script("creality.ld") |
18 changes: 5 additions & 13 deletions
18
buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
# | ||
# STM32F103RE_SKR_E3_DIP.py | ||
# buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py | ||
# Customizations for env:STM32F103RE_btt | ||
# | ||
import os | ||
import marlin | ||
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")) | ||
marlin.relocate_firmware("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 | ||
marlin.custom_ld_script("STM32F103RE_SKR_E3_DIP.ld") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,28 @@ | ||
# | ||
# STM32F103VE_longer.py | ||
# buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py | ||
# Customizations for env:STM32F103VE_longer | ||
# | ||
import os | ||
Import("env") | ||
import os,marlin | ||
|
||
# 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")) | ||
marlin.relocate_firmware("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 | ||
marlin.custom_ld_script("STM32F103VE_longer.ld") | ||
|
||
# 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,10 @@ | ||
# | ||
# fly_mini.py | ||
# buildroot/share/PlatformIO/scripts/fly_mini.py | ||
# Customizations for env:FLY_MINI | ||
# | ||
import os | ||
Import("env") | ||
import marlin | ||
|
||
# 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 | ||
marlin.relocate_firmware("0x08005000") | ||
|
||
marlin.custom_ld_script("fly_mini.ld") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.