Marlin 2.0 for Flying Bear 4S/5
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
857 B

#
4 years ago
# buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py
#
4 years ago
import os
from os.path import join
from os.path import expandvars
4 years ago
Import("env")
# Custom HEX from ELF
env.AddPostAction(
4 years ago
join("$BUILD_DIR", "${PROGNAME}.elf"),
env.VerboseAction(" ".join([
3 years ago
"$OBJCOPY", "-O ihex", "$TARGET",
4 years ago
"\"" + join("$BUILD_DIR", "${PROGNAME}.hex") + "\"", # Note: $BUILD_DIR is a full path
]), "Building $TARGET"))
# In-line command with arguments
UPLOAD_TOOL="stm32flash"
platform = env.PioPlatform()
if platform.get_package_dir("tool-stm32duino") != None:
UPLOAD_TOOL=expandvars("\"" + join(platform.get_package_dir("tool-stm32duino"),"stm32flash","stm32flash") + "\"")
env.Replace(
UPLOADER=UPLOAD_TOOL,
UPLOADCMD=expandvars(UPLOAD_TOOL + " -v -i rts,-dtr,dtr -R -b 115200 -g 0x8000000 -w \"" + join("$BUILD_DIR","${PROGNAME}.hex")+"\"" + " $UPLOAD_PORT")
)