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.

create_custom_upload_command_DFU.py 1.1KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #
  2. # Builds custom upload command
  3. # 1) Run platformio as a subprocess to find a COM port
  4. # 2) Build the upload command
  5. # 3) Exit and let upload tool do the work
  6. #
  7. # This script runs between completion of the library/dependencies installation and compilation.
  8. #
  9. # Will continue on if a COM port isn't found so that the compilation can be done.
  10. #
  11. import sys
  12. from SCons.Script import DefaultEnvironment
  13. import platform
  14. current_OS = platform.system()
  15. env = DefaultEnvironment()
  16. if current_OS == 'Windows':
  17. avrdude_conf_path = env.get("PIOHOME_DIR") + '\\packages\\toolchain-atmelavr\\etc\\avrdude.conf'
  18. source_path = env.get("PROJECTBUILD_DIR") + '\\' + env.get("PIOENV") + '\\firmware.hex'
  19. upload_string = 'avrdude -p usb1286 -c flip1 -C ' + avrdude_conf_path + ' -U flash:w:' + source_path + ':i'
  20. else:
  21. source_path = env.get("PROJECTBUILD_DIR") + '/' + env.get("PIOENV") + '/firmware.hex'
  22. upload_string = 'avrdude -p usb1286 -c flip1 -U flash:w:' + source_path + ':i'
  23. env.Replace(
  24. UPLOADCMD = upload_string,
  25. MAXIMUM_RAM_SIZE = 8192,
  26. MAXIMUM_SIZE = 130048
  27. )