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

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. # Custom HEX from ELF
  8. env.AddPostAction(
  9. join("$BUILD_DIR","${PROGNAME}.elf"),
  10. env.VerboseAction(" ".join([
  11. "$OBJCOPY", "-O ihex", "$TARGET", # TARGET=.pio/build/fysetc_STM32F1/firmware.elf
  12. "\"" + join("$BUILD_DIR","${PROGNAME}.hex") + "\"", # Note: $BUILD_DIR is a full path
  13. ]), "Building $TARGET"))
  14. # please keep $SOURCE variable, it will be replaced with a path to firmware
  15. # Generic
  16. #env.Replace(
  17. # UPLOADER="serial_upload.bat"
  18. # UPLOADCMD="$UPLOADER stm32loader.py $SOURCE"
  19. #)
  20. # In-line command with arguments
  21. UPLOAD_TOOL="stm32flash"
  22. platform = env.PioPlatform()
  23. if platform.get_package_dir("tool-stm32duino") != None:
  24. UPLOAD_TOOL=expandvars("\"" + join(platform.get_package_dir("tool-stm32duino"),"stm32flash","stm32flash") + "\"")
  25. env.Replace(
  26. UPLOADER=UPLOAD_TOOL,
  27. UPLOADCMD=expandvars(UPLOAD_TOOL + " -v -i rts,-dtr,dtr -R -b 115200 -g 0x8000000 -w \"" + join("$BUILD_DIR","${PROGNAME}.hex")+"\"" + " $UPLOAD_PORT")
  28. )
  29. # Python callback
  30. #def on_upload(source, target, env):
  31. # print source, target
  32. # firmware_path = str(source[0])
  33. # # do something
  34. # env.Execute(".\serial_upload.bat")
  35. #env.Replace(UPLOADCMD=on_upload)