Marlin_Firmware/buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py

44 lines
939 B
Python
Raw Normal View History

2021-02-27 22:38:57 -06:00
#
# STM32F103RC_MEEB_3DP.py
2021-02-27 22:38:57 -06:00
#
import pioutil
if pioutil.is_pio_build():
2020-06-01 18:25:13 -05:00
try:
import configparser
except ImportError:
import ConfigParser as configparser
2020-06-01 18:25:13 -05:00
import os
Import("env", "projenv")
2020-06-01 18:25:13 -05:00
config = configparser.ConfigParser()
config.read("platformio.ini")
#
# Upload actions
#
def before_upload(source, target, env):
env.Execute("pwd")
2020-06-01 18:25:13 -05:00
def after_upload(source, target, env):
env.Execute("pwd")
2020-06-01 18:25:13 -05:00
env.AddPreAction("upload", before_upload)
env.AddPostAction("upload", after_upload)
2020-06-01 18:25:13 -05:00
flash_size = 0
vect_tab_addr = 0
2020-06-01 18:25:13 -05:00
for define in env['CPPDEFINES']:
if define[0] == "VECT_TAB_ADDR":
vect_tab_addr = define[1]
if define[0] == "STM32_FLASH_SIZE":
flash_size = define[1]
2020-06-01 18:25:13 -05:00
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))
2020-06-01 18:25:13 -05:00
import marlin
marlin.custom_ld_script("STM32F103RC_MEEB_3DP.ld")