mirror of
https://github.com/martinloren/Artery-AT32-PlatformIO.git
synced 2026-05-21 09:22:14 +00:00
Update 2024-12
This commit is contained in:
@@ -42,7 +42,10 @@ mcu = board.get("build.mcu", "")
|
||||
product_line = board.get("build.product_line", "")
|
||||
assert product_line, "Missing MCU or Product Line field"
|
||||
|
||||
|
||||
print("-------------------------------------------------------------------------------");
|
||||
print("AT32 PlatformIO porting by MartinLoren®");
|
||||
print("-------------------------------------------------------------------------------");
|
||||
print("Version: 2024-12");
|
||||
|
||||
#env.SConscript("_bare.py")
|
||||
#build_script = "_bare.py"
|
||||
@@ -58,7 +61,11 @@ SConscript(build_script)
|
||||
|
||||
CMSIS_DIR = platform.get_package_dir("framework-cmsis")
|
||||
CMSIS_DEVICE_DIR = platform.get_package_dir("framework-cmsis-" + mcu[0:7])
|
||||
LDSCRIPTS_DIR = join('%s' % platform.get_dir() or "", "ldscripts")
|
||||
LDSCRIPTS_DIR = platform.get_package_dir("tool-ldscripts-at32")
|
||||
print("Environment:");
|
||||
print(" CMSIS_DIR: "+CMSIS_DIR);
|
||||
print(" CMSIS_DEVICE_DIR: "+CMSIS_DEVICE_DIR);
|
||||
print(" LDSCRIPTS_DIR: "+LDSCRIPTS_DIR);
|
||||
assert all(os.path.isdir(d) for d in (CMSIS_DIR, CMSIS_DEVICE_DIR, LDSCRIPTS_DIR))
|
||||
|
||||
|
||||
@@ -81,9 +88,9 @@ def generate_ldscript(default_ldscript_path):
|
||||
def get_linker_script():
|
||||
ldscript_match = glob.glob(os.path.join(
|
||||
LDSCRIPTS_DIR, mcu[0:7], mcu[0:11].upper() + "*_FLASH.ld"))
|
||||
|
||||
#print(os.path.join(LDSCRIPTS_DIR, mcu[0:7], mcu[0:11].upper() + "*_FLASH.ld"))
|
||||
|
||||
if ldscript_match and os.path.isfile(ldscript_match[0]):
|
||||
print("LD Script file: " +ldscript_match[0])
|
||||
return ldscript_match[0]
|
||||
|
||||
default_ldscript = os.path.join(
|
||||
@@ -99,7 +106,7 @@ def get_linker_script():
|
||||
|
||||
|
||||
def prepare_startup_file(src_path):
|
||||
startup_file = os.path.join(src_path, "gcc", "startup_%s.s" % product_line.lower())
|
||||
startup_file = os.path.join(src_path, "gcc", "startup_%s.S" % product_line.lower())
|
||||
print("Startup file: " + startup_file)
|
||||
# Change file extension to uppercase:
|
||||
if not os.path.isfile(startup_file) and os.path.isfile(startup_file[:-2] + ".s"):
|
||||
|
||||
Reference in New Issue
Block a user