import hid
import tkinter as tk

def force_stack_overflow():
    hid.Device(vid=0x35bd,pid=0x0101).send_feature_report(bytes([0, ord('>')])+b'CRASHNOW')

def force_hard_fault():
    hid.Device(vid=0x35bd,pid=0x0101).send_feature_report(bytes([0, ord(',')])+b'CRASHNOW')

def force_usused_isr():
    hid.Device(vid=0x35bd,pid=0x0101).send_feature_report(bytes([0, ord('.')])+b'CRASHNOW')

def main():
    root = tk.Tk()
    root.geometry("300x100")
    root.title("Force an Error")

    btn1 = tk.Button(root, text="Trigger a stack overflow", command=force_stack_overflow)
    btn2 = tk.Button(root, text="Trigger a hard fault", command=force_hard_fault)
    btn3 = tk.Button(root, text="Trigger a unused interrupt service routine", command=force_usused_isr)

    btn1.pack()
    btn2.pack()
    btn3.pack()

    root.mainloop()

if __name__ == '__main__':
    main()