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_MEEB_3DP.py 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #
  2. # buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py
  3. #
  4. try:
  5. import configparser
  6. except ImportError:
  7. import ConfigParser as configparser
  8. import os
  9. Import("env", "projenv")
  10. # access to global build environment
  11. print(env)
  12. # access to project build environment (is used source files in "src" folder)
  13. print(projenv)
  14. config = configparser.ConfigParser()
  15. config.read("platformio.ini")
  16. #com_port = config.get("env:STM32F103RC_meeb", "upload_port")
  17. #print('Use the {0:s} to reboot the board to dfu mode.'.format(com_port))
  18. #
  19. # Upload actions
  20. #
  21. def before_upload(source, target, env):
  22. print("before_upload")
  23. # do some actions
  24. # use com_port
  25. #
  26. env.Execute("pwd")
  27. def after_upload(source, target, env):
  28. print("after_upload")
  29. # do some actions
  30. #
  31. #
  32. env.Execute("pwd")
  33. print("Current build targets", map(str, BUILD_TARGETS))
  34. env.AddPreAction("upload", before_upload)
  35. env.AddPostAction("upload", after_upload)
  36. flash_size = 0
  37. vect_tab_addr = 0
  38. for define in env['CPPDEFINES']:
  39. if define[0] == "VECT_TAB_ADDR":
  40. vect_tab_addr = define[1]
  41. if define[0] == "STM32_FLASH_SIZE":
  42. flash_size = define[1]
  43. print('Use the {0:s} address as the marlin app entry point.'.format(vect_tab_addr))
  44. print('Use the {0:d}KB flash version of stm32f103rct6 chip.'.format(flash_size))
  45. import marlin
  46. marlin.custom_ld_script("STM32F103RC_MEEB_3DP.ld")