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.

fysetc_STM32F1.py 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. from os.path import join
  2. from os.path import expandvars
  3. Import("env", "projenv")
  4. # Relocate firmware from 0x08000000 to 0x08002000
  5. #env['CPPDEFINES'].remove(("VECT_TAB_ADDR", 134217728))
  6. #env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08010000"))
  7. #env.Replace(LDSCRIPT_PATH="buildroot/share/PlatformIO/ldscripts/fysetc_aio_ii.ld")
  8. # Custom HEX from ELF
  9. env.AddPostAction(
  10. join("$BUILD_DIR","${PROGNAME}.elf"),
  11. env.VerboseAction(" ".join([
  12. "$OBJCOPY", "-O ihex", "$TARGET", # TARGET=.pio/build/fysetc_STM32F1/firmware.elf
  13. "\"" + join("$BUILD_DIR","${PROGNAME}.hex") + "\"", # Note: $BUILD_DIR is a full path
  14. ]), "Building $TARGET"))
  15. # please keep $SOURCE variable, it will be replaced with a path to firmware
  16. # Generic
  17. #env.Replace(
  18. # UPLOADER="serial_upload.bat"
  19. # UPLOADCMD="$UPLOADER stm32loader.py $SOURCE"
  20. #)
  21. # In-line command with arguments
  22. UPLOAD_TOOL="stm32flash"
  23. platform = env.PioPlatform()
  24. if platform.get_package_dir("tool-stm32duino") != None:
  25. UPLOAD_TOOL=expandvars("\"" + join(platform.get_package_dir("tool-stm32duino"),"stm32flash","stm32flash") + "\"")
  26. env.Replace(
  27. UPLOADER=UPLOAD_TOOL,
  28. UPLOADCMD=expandvars(UPLOAD_TOOL + " -v -i rts,-dtr,dtr $UPLOAD_PORT -R -w \"" + join("$BUILD_DIR","${PROGNAME}.hex")+"\"")
  29. )
  30. # Python callback
  31. #def on_upload(source, target, env):
  32. # print source, target
  33. # firmware_path = str(source[0])
  34. # # do something
  35. # env.Execute(".\serial_upload.bat")
  36. #env.Replace(UPLOADCMD=on_upload)