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.

alfawise_Ux0.py 886B

123456789101112131415161718192021222324252627
  1. Import("env")
  2. # Relocate firmware from 0x08000000 to 0x08010000
  3. for define in env['CPPDEFINES']:
  4. if define[0] == "VECT_TAB_ADDR":
  5. env['CPPDEFINES'].remove(define)
  6. env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08010000"))
  7. env.Replace(LDSCRIPT_PATH="buildroot/share/PlatformIO/ldscripts/alfawise_Ux0.ld")
  8. # Rename ${PROGNAME}.bin and save it as 'project.bin' (No encryption on the Longer3D)
  9. def encrypt(source, target, env):
  10. import os
  11. firmware = open(target[0].path, "rb")
  12. marlin_alfa = open(target[0].dir.path +'/project.bin', "wb")
  13. length = os.path.getsize(target[0].path)
  14. position = 0
  15. try:
  16. while position < length:
  17. byte = firmware.read(1)
  18. marlin_alfa.write(byte)
  19. position += 1
  20. finally:
  21. firmware.close()
  22. marlin_alfa.close()
  23. env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt);