from raiden_python import raiden import time raiden = raiden.Raiden(mhz=100, serial_dev="/dev/lab_raiden", baud=115200, ticks=True) raiden.reset_glitcher() raiden.arm(0) print(raiden.get_buildtime()) raiden.set_param(param="CMD_VSTART", value=1) raiden.set_param(param="CMD_GLITCH_MAX", value=1) raiden.set_target_power("off") time.sleep(1) raiden.set_target_power("on") time.sleep(1) while True: raiden.set_target_power("auto") raiden.arm(0) raiden.reset_glitcher() raiden.set_param(param="CMD_GLITCH_DELAY", seconds=0) raiden.set_param(param="CMD_GLITCH_WIDTH", seconds=8) raiden.set_param(param="CMD_GLITCH_GAP", seconds=5) raiden.set_param(param="CMD_GLITCH_COUNT", value=3) raiden.arm(1) while not raiden.is_finished(): pass print("glitch cycle done")
debug=args.debug) #except: # print("Can't open Raiden!") # exit(True) raiden.reset_glitcher() raiden.arm(0) # reboot target raiden.set_target_power("off") time.sleep(1) raiden.set_target_power("on") time.sleep(1) raiden.set_target_power("auto") raiden.set_param(param="CMD_VSTART", value=1) raiden.set_param(param="CMD_GLITCH_COUNT", value=1) raiden.set_param(param="CMD_GLITCH_MAX", value=1) try: lpc = serial.Serial(args.lpc, baudrate=115200, timeout=0.1) except: print("Can't open STM11Uxx!") exit(True) # escape glitch mode in case we're re-starting lpc.write(b' ') lpc.write(b' ') while (42): text = lpc.readline().decode("UTF-8") if text == "":
#150 rest = 0 try: raiden = raiden.Raiden(mhz="100", serial_dev="/dev/cu.usbserial-00004114B", ticks=True) while (True): status = raiden.is_triggered() if (status): width = width_range.min while width < width_range.max: print("Current width: {0}".format(width)) for delay in range(delay, max_delay, 10): for glitch in range(1, 3, 1): raiden.arm(0) raiden.set_param(param="CMD_GLITCH_DELAY", seconds=delay) raiden.set_param(param="CMD_GLITCH_WIDTH", seconds=width) raiden.set_param(param="CMD_GLITCH_COUNT", value=glitch) raiden.arm(1) # print("Current delay: {0}".format(delay)) width += width_range.step delay = 0 else: raiden.arm(0) except KeyboardInterrupt: print("Raiden is going to stop...") raiden.arm(0) finally: raiden.arm(0)