Skip to content

Commit c44a53d

Browse files
committed
Updated SQN3330 firmware updater
1 parent e95b514 commit c44a53d

File tree

4 files changed

+549
-179
lines changed

4 files changed

+549
-179
lines changed

lib/sqnsupgrade/sqnsbr.py

Lines changed: 8 additions & 1 deletion
Large diffs are not rendered by default.

lib/sqnsupgrade/sqnsbrz.py

Lines changed: 53 additions & 0 deletions
Large diffs are not rendered by default.

lib/sqnsupgrade/sqnstp.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/usr/bin/env python
2+
# Copyright (c) 2016, Pycom Limited.
3+
#
4+
# This software is licensed under the GNU GPL version 3 or any
5+
# later version, with permitted additional terms. For more information
6+
# see the Pycom Licence v1.0 document supplied with this file, or
7+
# available at https://www.pycom.io/opensource/licensing
28

39
import struct
410
import time
@@ -59,9 +65,9 @@ def hexdump(src, length=32):
5965
lines = []
6066
for c in range(0, len(src), length):
6167
chars = src[c:c+length]
62-
hex = ' '.join(['%02x' % x for x in chars])
63-
printable = ''.join(['%s' % ((x <= 127 and FILTER[x]) or '.') for x in chars])
64-
lines.append('%04x %-*s %s\n' % (c, length*3, hex, printable))
68+
hex = ' '.join(["%02x" % ord(x) for x in chars])
69+
printable = ''.join(["%s" % ((ord(x) <= 127 and FILTER[ord(x)]) or '.') for x in chars])
70+
lines.append("%04x %-*s %s\n" % (c, length*3, hex, printable))
6571
print(''.join(lines))
6672

6773

@@ -374,17 +380,11 @@ def start(elf, elfsize, serial, baud=3686400, retry=None, debug=None, AT=True, p
374380

375381
while True:
376382
try:
377-
if debug: print('running m.wipe')
378383
m.wipe()
379-
if debug: print('running m.reset')
380384
m.reset()
381-
if debug: print('running m.open_session')
382385
m.open_session()
383-
if debug: print('running push(m)')
384386
push(m)
385-
if debug: print('running dev.set_timeout(2)')
386387
dev.set_timeout(2)
387-
if debug: print('running m.reset(True)')
388388
m.reset(True)
389389
return True
390390
except MException as ex:

0 commit comments

Comments
 (0)