X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=frprog.py;h=da4f399dcdbdc179a4d63b50f984e77bd0962768;hb=98d52dcf49cff3e0d77ea2f0a5ef16abd5dc1f7f;hp=8afad3f01e1f4ecb9dbe0181bd41afcc76dd6205;hpb=f5cf71eed2a3c037508b3c4901defa24412aba4f;p=pyfrprog.git diff --git a/frprog.py b/frprog.py index 8afad3f..da4f399 100755 --- a/frprog.py +++ b/frprog.py @@ -15,7 +15,6 @@ last_checksum = 0 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) @@ -188,10 +187,13 @@ tty = SerialPort(DEVICE, 100, REAL_BAUDRATE) # let the fun begin! for seq in flashseqs: - if(seq.address >= 0x148000): + if(seq.address <= 0x40000): + addr = seq.address + else: continue - print "RAMing", len(seq.data), "bytes at address", hex(seq.address) - cmdWRITE(seq.address - flashseqs[0].address + 0x30000, len(seq.data), seq.data) + print "RAMing", len(seq.data), "bytes at address", hex(addr) + cmdWRITE(addr, len(seq.data), seq.data) + tty.flush() cmdCALL(0x30000); sys.exit(0)