Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenSK
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
koenigl2
OpenSK
Commits
2aeeff3b
Unverified
Commit
2aeeff3b
authored
5 years ago
by
kaczmarczyck
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into info-2-1
parents
d9c4c729
b486ff44
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.github/workflows/python.yml
+3
-3
3 additions, 3 deletions
.github/workflows/python.yml
.vscode/settings.json
+1
-1
1 addition, 1 deletion
.vscode/settings.json
deploy.py
+20
-7
20 additions, 7 deletions
deploy.py
setup.sh
+1
-1
1 addition, 1 deletion
setup.sh
third_party/tock
+1
-1
1 addition, 1 deletion
third_party/tock
with
26 additions
and
13 deletions
.github/workflows/python.yml
+
3
−
3
View file @
2aeeff3b
...
@@ -22,7 +22,7 @@ jobs:
...
@@ -22,7 +22,7 @@ jobs:
-
name
:
Install dependencies
-
name
:
Install dependencies
run
:
|
run
:
|
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade pip setuptools wheel
pip install tockloader pylint
pip install
'
tockloader
~=1.4'
pylint
-
name
:
Register matcher
-
name
:
Register matcher
run
:
echo ::add-matcher::./.github/python_matcher.json
run
:
echo ::add-matcher::./.github/python_matcher.json
-
name
:
Test code with pylint
-
name
:
Test code with pylint
...
@@ -39,8 +39,8 @@ jobs:
...
@@ -39,8 +39,8 @@ jobs:
-
name
:
Install dependencies
-
name
:
Install dependencies
run
:
|
run
:
|
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade pip setuptools wheel
pip install yapf tockloader
pip install
'
yapf
>=0.30.0'
tockloader
-
name
:
Test code formatting with yapf
-
name
:
Test code formatting with yapf
run
:
|
run
:
|
echo ::add-matcher::./.github/python_matcher.json
echo ::add-matcher::./.github/python_matcher.json
yapf --style=
chromium
--recursive --exclude third_party --diff .
yapf --style=
yapf
--recursive --exclude third_party --diff .
This diff is collapsed.
Click to expand it.
.vscode/settings.json
+
1
−
1
View file @
2aeeff3b
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
//
Try
to
make
VSCode
formating
as
close
as
possible
to
the
Google
style.
//
Try
to
make
VSCode
formating
as
close
as
possible
to
the
Google
style.
"python.formatting.provider"
:
"yapf"
,
"python.formatting.provider"
:
"yapf"
,
"python.formatting.yapfArgs"
:
[
"python.formatting.yapfArgs"
:
[
"--style=
chromium
"
"--style=
yapf
"
],
],
"python.linting.enabled"
:
true
,
"python.linting.enabled"
:
true
,
"python.linting.lintOnSave"
:
true
,
"python.linting.lintOnSave"
:
true
,
...
...
This diff is collapsed.
Click to expand it.
deploy.py
+
20
−
7
View file @
2aeeff3b
...
@@ -29,6 +29,7 @@ import sys
...
@@ -29,6 +29,7 @@ import sys
import
colorama
import
colorama
from
six.moves
import
input
from
six.moves
import
input
import
tockloader
from
tockloader
import
tab
from
tockloader
import
tab
from
tockloader
import
tbfh
from
tockloader
import
tbfh
from
tockloader
import
tockloader
as
loader
from
tockloader
import
tockloader
as
loader
...
@@ -252,12 +253,16 @@ class OpenSKInstaller:
...
@@ -252,12 +253,16 @@ class OpenSKInstaller:
board
=
self
.
args
.
board
,
board
=
self
.
args
.
board
,
debug
=
False
,
debug
=
False
,
force
=
False
,
force
=
False
,
jlink_cmd
=
"
JLinkExe
"
,
jlink
=
self
.
args
.
programmer
==
"
jlink
"
,
jlink
=
self
.
args
.
programmer
==
"
jlink
"
,
jlink_device
=
board
.
jlink_device
,
jlink_device
=
board
.
jlink_device
,
jlink_if
=
board
.
jlink_if
,
jlink_if
=
board
.
jlink_if
,
jlink_speed
=
1200
,
jlink_speed
=
1200
,
openocd
=
self
.
args
.
programmer
==
"
openocd
"
,
openocd
=
self
.
args
.
programmer
==
"
openocd
"
,
openocd_board
=
board
.
openocd_board
,
openocd_board
=
board
.
openocd_board
,
openocd_cmd
=
"
openocd
"
,
openocd_commands
=
copy
.
copy
(
board
.
openocd_commands
),
openocd_options
=
copy
.
copy
(
board
.
openocd_options
),
jtag
=
False
,
jtag
=
False
,
no_bootloader_entry
=
False
,
no_bootloader_entry
=
False
,
page_size
=
board
.
page_size
,
page_size
=
board
.
page_size
,
...
@@ -291,8 +296,8 @@ class OpenSKInstaller:
...
@@ -291,8 +296,8 @@ class OpenSKInstaller:
# empty value.
# empty value.
target_toolchain
.
append
(
""
)
target_toolchain
.
append
(
""
)
current_version
=
self
.
checked_command_output
([
"
rustc
"
,
"
--version
"
])
current_version
=
self
.
checked_command_output
([
"
rustc
"
,
"
--version
"
])
if
not
all
(
(
target_toolchain
[
0
]
in
current_version
,
if
not
(
target_toolchain
[
0
]
in
current_version
and
target_toolchain
[
1
]
in
current_version
)
)
:
target_toolchain
[
1
]
in
current_version
):
info
(
"
Updating rust toolchain to {}
"
.
format
(
"
-
"
.
join
(
target_toolchain
)))
info
(
"
Updating rust toolchain to {}
"
.
format
(
"
-
"
.
join
(
target_toolchain
)))
# Need to update
# Need to update
self
.
checked_command_output
(
self
.
checked_command_output
(
...
@@ -399,7 +404,7 @@ class OpenSKInstaller:
...
@@ -399,7 +404,7 @@ class OpenSKInstaller:
setattr
(
args
,
"
make
"
,
False
)
setattr
(
args
,
"
make
"
,
False
)
setattr
(
args
,
"
no_replace
"
,
False
)
setattr
(
args
,
"
no_replace
"
,
False
)
tock
=
loader
.
TockLoader
(
args
)
tock
=
loader
.
TockLoader
(
args
)
tock
.
open
(
args
)
tock
.
open
()
tabs
=
[
tab
.
TAB
(
tab_filename
)]
tabs
=
[
tab
.
TAB
(
tab_filename
)]
try
:
try
:
tock
.
install
(
tabs
,
replace
=
"
yes
"
,
erase
=
args
.
erase
)
tock
.
install
(
tabs
,
replace
=
"
yes
"
,
erase
=
args
.
erase
)
...
@@ -428,7 +433,7 @@ class OpenSKInstaller:
...
@@ -428,7 +433,7 @@ class OpenSKInstaller:
args
=
copy
.
copy
(
self
.
tockloader_default_args
)
args
=
copy
.
copy
(
self
.
tockloader_default_args
)
setattr
(
args
,
"
address
"
,
board_props
.
app_address
)
setattr
(
args
,
"
address
"
,
board_props
.
app_address
)
tock
=
loader
.
TockLoader
(
args
)
tock
=
loader
.
TockLoader
(
args
)
tock
.
open
(
args
)
tock
.
open
()
try
:
try
:
tock
.
flash_binary
(
kernel
,
board_props
.
kernel_address
)
tock
.
flash_binary
(
kernel
,
board_props
.
kernel_address
)
except
TockLoaderException
as
e
:
except
TockLoaderException
as
e
:
...
@@ -441,7 +446,7 @@ class OpenSKInstaller:
...
@@ -441,7 +446,7 @@ class OpenSKInstaller:
args
=
copy
.
copy
(
self
.
tockloader_default_args
)
args
=
copy
.
copy
(
self
.
tockloader_default_args
)
setattr
(
args
,
"
address
"
,
board_props
.
padding_address
)
setattr
(
args
,
"
address
"
,
board_props
.
padding_address
)
tock
=
loader
.
TockLoader
(
args
)
tock
=
loader
.
TockLoader
(
args
)
tock
.
open
(
args
)
tock
.
open
()
try
:
try
:
tock
.
flash_binary
(
padding
,
args
.
address
)
tock
.
flash_binary
(
padding
,
args
.
address
)
except
TockLoaderException
as
e
:
except
TockLoaderException
as
e
:
...
@@ -451,11 +456,14 @@ class OpenSKInstaller:
...
@@ -451,11 +456,14 @@ class OpenSKInstaller:
args
=
copy
.
copy
(
self
.
tockloader_default_args
)
args
=
copy
.
copy
(
self
.
tockloader_default_args
)
board_props
=
SUPPORTED_BOARDS
[
self
.
args
.
board
]
board_props
=
SUPPORTED_BOARDS
[
self
.
args
.
board
]
setattr
(
args
,
"
app_address
"
,
board_props
.
app_address
)
setattr
(
args
,
"
app_address
"
,
board_props
.
app_address
)
# Ensure we don't force erase all apps but only the apps starting
# at `board.app_address`. This makes sure we don't erase the padding.
setattr
(
args
,
"
force
"
,
False
)
info
(
"
Erasing all installed applications
"
)
info
(
"
Erasing all installed applications
"
)
tock
=
loader
.
TockLoader
(
args
)
tock
=
loader
.
TockLoader
(
args
)
tock
.
open
(
args
)
tock
.
open
()
try
:
try
:
tock
.
erase_apps
(
False
)
tock
.
erase_apps
()
except
TockLoaderException
as
e
:
except
TockLoaderException
as
e
:
# Erasing apps is not critical
# Erasing apps is not critical
info
((
"
A non-critical error occurred while erasing
"
info
((
"
A non-critical error occurred while erasing
"
...
@@ -467,6 +475,7 @@ class OpenSKInstaller:
...
@@ -467,6 +475,7 @@ class OpenSKInstaller:
return
False
return
False
args
=
copy
.
copy
(
self
.
tockloader_default_args
)
args
=
copy
.
copy
(
self
.
tockloader_default_args
)
tock
=
loader
.
TockLoader
(
args
)
tock
=
loader
.
TockLoader
(
args
)
tock
.
open
()
app_found
=
False
app_found
=
False
with
tock
.
_start_communication_with_board
():
with
tock
.
_start_communication_with_board
():
apps
=
[
app
.
name
for
app
in
tock
.
_extract_all_app_headers
()]
apps
=
[
app
.
name
for
app
in
tock
.
_extract_all_app_headers
()]
...
@@ -515,6 +524,10 @@ class OpenSKInstaller:
...
@@ -515,6 +524,10 @@ class OpenSKInstaller:
final_hex
.
tofile
(
dest_file
,
format
=
"
hex
"
)
final_hex
.
tofile
(
dest_file
,
format
=
"
hex
"
)
def
check_prerequisites
(
self
):
def
check_prerequisites
(
self
):
if
not
tockloader
.
__version__
.
startswith
(
"
1.4.
"
):
fatal
((
"
Your version of tockloader seems incompatible: found {},
"
"
expected 1.4.x.
"
.
format
(
tockloader
.
__version__
)))
if
self
.
args
.
programmer
==
"
jlink
"
:
if
self
.
args
.
programmer
==
"
jlink
"
:
assert_mandatory_binary
(
"
JLinkExe
"
)
assert_mandatory_binary
(
"
JLinkExe
"
)
...
...
This diff is collapsed.
Click to expand it.
setup.sh
+
1
−
1
View file @
2aeeff3b
...
@@ -86,7 +86,7 @@ source tools/gen_key_materials.sh
...
@@ -86,7 +86,7 @@ source tools/gen_key_materials.sh
generate_crypto_materials N
generate_crypto_materials N
rustup
install
$(
head
-n
1 rust-toolchain
)
rustup
install
$(
head
-n
1 rust-toolchain
)
pip3
install
--user
--upgrade
tockloader six intelhex
pip3
install
--user
--upgrade
'
tockloader
~=1.4'
six intelhex
rustup target add thumbv7em-none-eabi
rustup target add thumbv7em-none-eabi
# Install dependency to create applications.
# Install dependency to create applications.
...
...
This diff is collapsed.
Click to expand it.
tock
@
f1f9d717
Compare
ba44dd69
...
f1f9d717
Subproject commit
ba44dd690f2db52ab9c928975f85c34c1c6f5bea
Subproject commit
f1f9d717a4d9b5ae934a3b50ce6a18e6dff3e7c7
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