My Marlin configs for Fabrikator Mini and CTC i3 Pro B
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.

STM32F103RC_fysetc.py 1.3KB

123456789101112131415161718192021222324252627282930313233343536
  1. import os
  2. from os.path import join
  3. from os.path import expandvars
  4. Import("env")
  5. # Relocate firmware from 0x08000000 to 0x08008000
  6. #for define in env['CPPDEFINES']:
  7. # if define[0] == "VECT_TAB_ADDR":
  8. # env['CPPDEFINES'].remove(define)
  9. #env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08008000"))
  10. #custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/fysetc_stm32f103rc.ld")
  11. #for i, flag in enumerate(env["LINKFLAGS"]):
  12. # if "-Wl,-T" in flag:
  13. # env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script
  14. # elif flag == "-T":
  15. # env["LINKFLAGS"][i + 1] = custom_ld_script
  16. # Custom HEX from ELF
  17. env.AddPostAction(
  18. join("$BUILD_DIR","${PROGNAME}.elf"),
  19. env.VerboseAction(" ".join([
  20. "$OBJCOPY", "-O ihex", "$TARGET", # TARGET=.pio/build/fysetc_STM32F1/firmware.elf
  21. "\"" + join("$BUILD_DIR","${PROGNAME}.hex") + "\"", # Note: $BUILD_DIR is a full path
  22. ]), "Building $TARGET"))
  23. # In-line command with arguments
  24. UPLOAD_TOOL="stm32flash"
  25. platform = env.PioPlatform()
  26. if platform.get_package_dir("tool-stm32duino") != None:
  27. UPLOAD_TOOL=expandvars("\"" + join(platform.get_package_dir("tool-stm32duino"),"stm32flash","stm32flash") + "\"")
  28. env.Replace(
  29. UPLOADER=UPLOAD_TOOL,
  30. UPLOADCMD=expandvars(UPLOAD_TOOL + " -v -i rts,-dtr,dtr -R -b 115200 -g 0x8000000 -w \"" + join("$BUILD_DIR","${PROGNAME}.hex")+"\"" + " $UPLOAD_PORT")
  31. )