def sendByte(byte):
time.sleep(0.001) # just to get sure, wait 1ms
tty.write(chr(byte))
- tty.flush()
def sendWord(word):
sendByte(word & 0xFF)
recvChecksum()
def cmdBAUDRATE(baudrate):
- global last_checksum
-
# send BAUDRATE command
sendByte(0x01)
if (recvByte() != 0xF1):
if (recvByte() != 0x86):
raise Exception
# send desired baudrate
- sendByte(baudrate & 0xFF)
- sendByte((baudrate >> 8) & 0xFF)
- sendByte((baudrate >> 16) & 0xFF)
- sendByte((baudrate >> 24) & 0xFF)
+ sendDWord(baudrate)
class FlashSequence(object):
def __init__(self, address, data):
# let the fun begin!
for seq in flashseqs:
- print "Flashing", len(seq.data), "bytes at address", hex(seq.address)
- cmdWRITE(seq.address, len(seq.data), seq.data)
+ if(seq.address <= 0x40000):
+ addr = seq.address
+ else:
+ continue
+ print "RAMing", len(seq.data), "bytes at address", hex(addr)
+ cmdWRITE(addr, len(seq.data), seq.data)
+ tty.flush()
+
+cmdCALL(0x30000);
sys.exit(0)
print
"""
-
+"""
# write some data in the iram and try to execute it
data_wr =[
0x9B,0x00,
print "Received Checksum:", last_checksum
print
cmdCALL(0x00030000)
+"""