Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
d02f6717
Commit
d02f6717
authored
Jun 24, 2015
by
Daniel Campora
Browse files
cc3200: Add deploy target and improve robustness of update-wipy.py.
parent
d709622b
Changes
2
Hide whitespace changes
Inline
Side-by-side
cc3200/application.mk
View file @
d02f6717
...
...
@@ -215,9 +215,19 @@ endif
SHELL
=
bash
APP_SIGN
=
appsign.sh
UPDATE_WIPY
?=
tools/update-wipy.py
WIPY_IP
?=
'192.168.1.1'
WIPY_USER
?=
'micro'
WIPY_PWD
?=
'python'
all
:
$(BUILD)/mcuimg.bin
.PHONY
:
deploy
deploy
:
$(BUILD)/mcuimg.bin
$(ECHO)
"Writing
$<
to the board"
$(Q)$(PYTHON)
$(UPDATE_WIPY)
--verify
--ip
$(WIPY_IP)
--user
$(WIPY_USER)
--password
$(WIPY_PWD)
--file
$<
$(BUILD)/application.axf
:
$(OBJ) $(LINKER_SCRIPT)
$(ECHO)
"LINK
$@
"
$(Q)$(CC)
-o
$@
$(LDFLAGS)
$(OBJ)
$(LIBS)
...
...
cc3200/tools/update-wipy.py
View file @
d02f6717
...
...
@@ -21,7 +21,7 @@ from telnetlib import Telnet
def
print_exception
(
e
):
print
(
'E
rror
: {}, on line {}'
.
format
(
e
,
sys
.
exc_info
()[
-
1
].
tb_lineno
))
print
(
'E
xception
: {}, on line {}'
.
format
(
e
,
sys
.
exc_info
()[
-
1
].
tb_lineno
))
def
transfer_file
(
args
):
...
...
@@ -65,13 +65,19 @@ def reset_board(args):
time
.
sleep
(
1
)
tn
.
write
(
bytes
(
args
.
password
,
'ascii'
)
+
b
"
\r\n
"
)
if
b
"Login succeeded!"
in
tn
.
read_until
(
b
"
for more information.
"
,
timeout
=
5
):
if
b
'Type "help()" for more information.'
in
tn
.
read_until
(
b
'Type "help()"
for more information.
'
,
timeout
=
5
):
print
(
"Telnet login succeeded"
)
tn
.
write
(
b
"import pyb
\r\n
"
)
tn
.
write
(
b
"pyb.reset()
\r\n
"
)
tn
.
write
(
b
'
\r\x03\x03
'
)
# ctrl-C twice: interrupt any running program
time
.
sleep
(
1
)
print
(
"Reset performed"
)
success
=
True
tn
.
write
(
b
'
\r\x02
'
)
# ctrl-B: enter friendly REPL
if
b
'Type "help()" for more information.'
in
tn
.
read_until
(
b
'Type "help()" for more information.'
,
timeout
=
5
):
tn
.
write
(
b
"import pyb
\r\n
"
)
tn
.
write
(
b
"pyb.reset()
\r\n
"
)
time
.
sleep
(
1
)
print
(
"Reset performed"
)
success
=
True
else
:
print
(
"Error: cannot enter friendly REPL"
)
else
:
print
(
"Error: telnet login failed"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment