aboutsummaryrefslogtreecommitdiffstats
path: root/support/scripts/reset.py
blob: 90ff33116bec0c4d59b48f005d518a1a8ce91771 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/python

import serial
import os
from struct import pack
try:
    ser = serial.Serial('/dev/ttyACM0', baudrate=115200)
    ser.open()

    # toggle DTR
    ser.setDTR(1)
    ser.setDTR(0)

    ser.write("1EAF")

    # close
    ser.close()

except:
    print "Failed to open the serial port for reset, perhaps this is your first upload or the board was already in bootloader mode"