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

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