Exemplo n.º 1
0
def main():
	import threading
	if sys.argv[1] == 'AUTO':
		print portList()
		for port in portList():
			threading.Thread(target=runProgrammer, args=(port,sys.argv[2])).start()
			time.sleep(5)
	else:
		programmer = Stk500v2()
		programmer.connect(port = sys.argv[1])
		programmer.programChip(intelHex.readHex(sys.argv[2]))
		sys.exit(1)
Exemplo n.º 2
0
def main():
	import threading
	if sys.argv[1] == 'AUTO':
		print portList()
		for port in portList():
			threading.Thread(target=runProgrammer, args=(port,sys.argv[2])).start()
			time.sleep(5)
	else:
		programmer = Stk500v2()
		programmer.connect(port = sys.argv[1])
		programmer.programChip(intelHex.readHex(sys.argv[2]))
		sys.exit(1)
Exemplo n.º 3
0
def main():
	""" Entry point to call the stk500v2 programmer from the commandline. """
	import threading
	if sys.argv[1] == 'AUTO':
		print portList()
		for port in portList():
			threading.Thread(target=runProgrammer, args=(port,sys.argv[2])).start()
			time.sleep(5)
	else:
		programmer = Stk500v2()
		programmer.connect(port = sys.argv[1])
		programmer.programChip(intelHex.readHex(sys.argv[2]))
		sys.exit(1)
Exemplo n.º 4
0
def main():
	""" Entry point to call the stk500v2 programmer from the commandline. """
	import threading
	if sys.argv[1] == 'AUTO':
		print portList()
		for port in portList():
			threading.Thread(target=runProgrammer, args=(port,sys.argv[2])).start()
			time.sleep(5)
	else:
		programmer = Stk500v2()
		programmer.connect(port = sys.argv[1])
		programmer.programChip(intelHex.readHex(sys.argv[2]))
		sys.exit(1)
Exemplo n.º 5
0
def main():
	programmer = Stk500v2()
	if sys.argv[1] == 'AUTO':
		import _winreg
		key=_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,"HARDWARE\\DEVICEMAP\\SERIALCOMM")
		i=0
		while True:
			values = _winreg.EnumValue(key, i)
			if 'USBSER' in values[0]:
				programmer.connect(port = values[1])
				break
			i+=1
	else:
		programmer.connect(port = sys.argv[1])
	programmer.programChip(intelHex.readHex(sys.argv[2]))
	sys.exit(1)
Exemplo n.º 6
0
def runProgrammer(port, filename):
    """ Run an STK500v2 program on serial port 'port' and write 'filename' into flash. """
    programmer = Stk500v2()
    programmer.connect(port=port)
    programmer.programChip(intelHex.readHex(filename))
    programmer.close()
Exemplo n.º 7
0
def runProgrammer(port, filename):
	programmer = Stk500v2()
	programmer.connect(port = port)
	programmer.programChip(intelHex.readHex(filename))
	programmer.close()
Exemplo n.º 8
0
def main():
    programmer = Stk500v2()
    programmer.connect(port=sys.argv[1])
    programmer.programChip(intelHex.readHex(sys.argv[2]))
    sys.exit(1)
Exemplo n.º 9
0
def main():
	programmer = Stk500v2()
	programmer.connect(port = sys.argv[1])
	programmer.programChip(intelHex.readHex(sys.argv[2]))
	sys.exit(1)
Exemplo n.º 10
0
def main():
	programmer = Stk500v2()
	programmer.connect()
	programmer.programChip(intelHex.readHex("cfg_4f55234def059.hex"))
	sys.exit(1)
Exemplo n.º 11
0
def main():
    programmer = Stk500v2()
    programmer.connect()
    programmer.programChip(intelHex.readHex("cfg_4f55234def059.hex"))
    sys.exit(1)
Exemplo n.º 12
0
def runProgrammer(port, filename):
	programmer = Stk500v2()
	programmer.connect(port = port)
	programmer.programChip(intelHex.readHex(filename))
	programmer.close()
Exemplo n.º 13
0
def runProgrammer(port, filename):
	""" Run an STK500v2 program on serial port 'port' and write 'filename' into flash. """
	programmer = Stk500v2()
	programmer.connect(port = port)
	programmer.programChip(intelHex.readHex(filename))
	programmer.close()