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.4KB

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