Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
8cd9fedf
Commit
8cd9fedf
authored
9 years ago
by
Daniel Campora
Browse files
Options
Downloads
Patches
Plain Diff
cc3200: Add script to program the WiPy via UniFlash (windows only...).
parent
e23ae639
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cc3200/tools/uniflash.py
+56
-0
56 additions, 0 deletions
cc3200/tools/uniflash.py
with
56 additions
and
0 deletions
cc3200/tools/uniflash.py
0 → 100644
+
56
−
0
View file @
8cd9fedf
#!/usr/bin/env python
"""
Flash the WiPy (format, update service pack and program).
Example:
> python uniflash.py -u
"
C:
\t
i\uniflash_3.2\uniflashCLI.bat
"
-c
"
C:\VirtualBoxShared\GitHub\wipy_uniflash.usf
"
-p 8 -s
"
C:
\t
i\CC31xx_CC32xx_ServicePack_1.0.0.10.0\servicepack_1.0.0.10.0.bin
"
or:
> python uniflash.py -u
"
C:
\t
i\uniflash_3.2\uniflashCLI.bat
"
-c
"
C:\VirtualBoxShared\GitHub\launchxl_uniflash.usf
"
-p 8 -s
"
C:
\t
i\CC31xx_CC32xx_ServicePack_1.0.0.10.0\servicepack_1.0.0.10.0.bin
"
"""
import
sys
import
argparse
import
subprocess
def
print_exception
(
e
):
print
(
'
Exception: {}, on line {}
'
.
format
(
e
,
sys
.
exc_info
()[
-
1
].
tb_lineno
))
def
main
():
cmd_parser
=
argparse
.
ArgumentParser
(
description
=
'
Flash the WiPy and optionally run a small test on it.
'
)
cmd_parser
.
add_argument
(
'
-u
'
,
'
--uniflash
'
,
default
=
None
,
help
=
'
the path to the uniflash cli executable
'
)
cmd_parser
.
add_argument
(
'
-c
'
,
'
--config
'
,
default
=
None
,
help
=
'
the path to the uniflash config file
'
)
cmd_parser
.
add_argument
(
'
-p
'
,
'
--port
'
,
default
=
8
,
help
=
'
the com serial port
'
)
cmd_parser
.
add_argument
(
'
-s
'
,
'
--servicepack
'
,
default
=
None
,
help
=
'
the path to the servicepack file
'
)
args
=
cmd_parser
.
parse_args
()
result
=
1
com_port
=
'
com=
'
+
str
(
args
.
port
)
servicepack_path
=
'
spPath=
'
+
args
.
servicepack
try
:
if
args
.
uniflash
==
None
or
args
.
config
==
None
:
raise
ValueError
(
'
uniflash path and config path are mandatory
'
)
if
args
.
servicepack
==
None
:
subprocess
.
check_call
([
args
.
uniflash
,
'
-config
'
,
args
.
config
,
'
-setOptions
'
,
com_port
,
'
-operations
'
,
'
format
'
,
'
program
'
],
stderr
=
subprocess
.
STDOUT
)
else
:
subprocess
.
check_call
([
args
.
uniflash
,
'
-config
'
,
args
.
config
,
'
-setOptions
'
,
com_port
,
servicepack_path
,
'
-operations
'
,
'
format
'
,
'
servicePackUpdate
'
,
'
program
'
],
stderr
=
subprocess
.
STDOUT
)
result
=
0
except
Exception
as
e
:
print_exception
(
e
)
finally
:
if
result
:
print
(
"
ERROR: Programming failed!
"
)
else
:
print
(
"
Board programmed OK
"
)
sys
.
exit
(
result
)
if
__name__
==
"
__main__
"
:
main
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment