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
GitLab 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
b22832e9
Commit
b22832e9
authored
Mar 11, 2020
by
Jean-Michel Picod
Browse files
Options
Downloads
Patches
Plain Diff
Rely on Makefile to build Tock OS
parent
550098d5
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
boards/nrf52840_dongle_dfu/Makefile
+29
-0
29 additions, 0 deletions
boards/nrf52840_dongle_dfu/Makefile
boards/nrf52840_mdk_dfu/Makefile
+29
-0
29 additions, 0 deletions
boards/nrf52840_mdk_dfu/Makefile
deploy.py
+1
-47
1 addition, 47 deletions
deploy.py
with
59 additions
and
47 deletions
boards/nrf52840_dongle_dfu/Makefile
0 → 100644
+
29
−
0
View file @
b22832e9
# Makefile for building the tock kernel for the nRF development kit
TOCK_ARCH
=
cortex-m4
TARGET
=
thumbv7em-none-eabi
PLATFORM
=
nrf52840_dongle_dfu
include
../../third_party/tock/boards/Makefile.common
TOCKLOADER
=
tockloader
# Where in the nrf52 flash to load the kernel with `tockloader`
KERNEL_ADDRESS
=
0x01000
# Upload programs over uart with tockloader
ifdef
PORT
TOCKLOADER_GENERAL_FLAGS
+=
--port
$(
PORT
)
endif
TOCKLOADER_JTAG_FLAGS
=
--jlink
--arch
$(
TOCK_ARCH
)
--board
$(
PLATFORM
)
--page-size
4096
--jlink-device
nrf52840_xxaa
# Upload the kernel over JTAG
.PHONY
:
flash
flash
:
target/$(TARGET)/release/$(PLATFORM).bin
$(
TOCKLOADER
)
$(
TOCKLOADER_GENERAL_FLAGS
)
flash
--address
$(
KERNEL_ADDRESS
)
$(
TOCKLOADER_JTAG_FLAGS
)
$<
# Upload the kernel over serial/bootloader
.PHONY
:
program
program
:
target/$(TARGET)/release/$(PLATFORM).hex
$(
error Cannot program nRF52 Dongle over USB. Use
\`
make flash
\`
and JTAG
)
This diff is collapsed.
Click to expand it.
boards/nrf52840_mdk_dfu/Makefile
0 → 100644
+
29
−
0
View file @
b22832e9
# Makefile for building the tock kernel for the nRF development kit
TOCK_ARCH
=
cortex-m4
TARGET
=
thumbv7em-none-eabi
PLATFORM
=
nrf52840_mdk_dfu
include
../../third_party/tock/boards/Makefile.common
TOCKLOADER
=
tockloader
# Where in the nrf52 flash to load the kernel with `tockloader`
KERNEL_ADDRESS
=
0x01000
# Upload programs over uart with tockloader
ifdef
PORT
TOCKLOADER_GENERAL_FLAGS
+=
--port
$(
PORT
)
endif
TOCKLOADER_JTAG_FLAGS
=
--jlink
--arch
$(
TOCK_ARCH
)
--board
$(
PLATFORM
)
--page-size
4096
--jlink-device
nrf52840_xxaa
# Upload the kernel over JTAG
.PHONY
:
flash
flash
:
target/$(TARGET)/release/$(PLATFORM).bin
$(
TOCKLOADER
)
$(
TOCKLOADER_GENERAL_FLAGS
)
flash
--address
$(
KERNEL_ADDRESS
)
$(
TOCKLOADER_JTAG_FLAGS
)
$<
# Upload the kernel over serial/bootloader
.PHONY
:
program
program
:
target/$(TARGET)/release/$(PLATFORM).hex
$(
error Cannot program nRF52 Dongle over USB. Use
\`
make flash
\`
and JTAG
)
This diff is collapsed.
Click to expand it.
deploy.py
+
1
−
47
View file @
b22832e9
...
@@ -298,58 +298,12 @@ class OpenSKInstaller:
...
@@ -298,58 +298,12 @@ class OpenSKInstaller:
self
.
checked_command_output
([
"
rustup
"
,
"
target
"
,
"
add
"
,
arch
])
self
.
checked_command_output
([
"
rustup
"
,
"
target
"
,
"
add
"
,
arch
])
info
(
"
Rust toolchain up-to-date
"
)
info
(
"
Rust toolchain up-to-date
"
)
def
search_binary
(
self
,
name
,
start_directory
=
"
.
"
):
for
root
,
_
,
files
in
os
.
walk
(
start_directory
):
for
fname
in
files
:
if
fname
==
name
:
return
os
.
path
.
join
(
root
,
fname
)
return
None
def
build_tockos
(
self
):
def
build_tockos
(
self
):
info
(
"
Building Tock OS for board {}
"
.
format
(
self
.
args
.
board
))
info
(
"
Building Tock OS for board {}
"
.
format
(
self
.
args
.
board
))
props
=
SUPPORTED_BOARDS
[
self
.
args
.
board
]
props
=
SUPPORTED_BOARDS
[
self
.
args
.
board
]
out_directory
=
os
.
path
.
join
(
props
.
path
,
"
target
"
,
props
.
arch
,
"
release
"
)
out_directory
=
os
.
path
.
join
(
props
.
path
,
"
target
"
,
props
.
arch
,
"
release
"
)
os
.
makedirs
(
out_directory
,
exist_ok
=
True
)
os
.
makedirs
(
out_directory
,
exist_ok
=
True
)
rust_flags
=
[
self
.
checked_command_output
([
"
make
"
],
cwd
=
props
.
path
)
"
-C
"
,
"
link-arg=-Tlayout.ld
"
,
"
-C
"
,
"
linker=rust-lld
"
,
"
-C
"
,
"
linker-flavor=ld.lld
"
,
"
-C
"
,
"
relocation-model=dynamic-no-pic
"
,
"
-C
"
,
"
link-arg=-zmax-page-size=512
"
,
"
--remap-path-prefix={}=
"
.
format
(
os
.
path
.
realpath
(
props
.
path
)),
]
env
=
os
.
environ
.
copy
()
env
[
"
RUSTFLAGS
"
]
=
"
"
.
join
(
rust_flags
)
self
.
checked_command_output
(
[
"
cargo
"
,
"
build
"
,
"
--release
"
,
"
--target={}
"
.
format
(
props
.
arch
)],
env
=
env
,
cwd
=
props
.
path
)
info
(
"
Converting Tock OS file into a binary
"
)
kernel_name
=
os
.
path
.
basename
(
props
.
path
)
shutil
.
copyfile
(
os
.
path
.
join
(
out_directory
,
kernel_name
),
os
.
path
.
join
(
out_directory
,
"
{}.elf
"
.
format
(
kernel_name
)))
# Find appropriate llvm-objcopy
llvm_dir
=
self
.
checked_command_output
([
"
rustc
"
,
"
--print=sysroot
"
],
cwd
=
props
.
path
).
strip
()
if
not
llvm_dir
:
fatal
(
"
Couldn
'
t determine where rustc is installed.
"
"
This shouldn
'
t happen.
"
)
if
not
os
.
path
.
isdir
(
llvm_dir
):
fatal
(
"
Something went wrong while locating llvm-objcopy.
"
)
objcopy
=
self
.
search_binary
(
"
llvm-objcopy
"
,
start_directory
=
llvm_dir
)
if
not
objcopy
:
fatal
(
"
Couldn
'
t locate llvm-objcopy binary in your system.
"
)
self
.
checked_command_output
([
objcopy
,
"
--output-target=binary
"
,
os
.
path
.
join
(
out_directory
,
"
{}.elf
"
.
format
(
kernel_name
)),
os
.
path
.
join
(
out_directory
,
"
{}.bin
"
.
format
(
kernel_name
))
])
def
build_example
(
self
):
def
build_example
(
self
):
info
(
"
Building example {}
"
.
format
(
self
.
args
.
application
))
info
(
"
Building example {}
"
.
format
(
self
.
args
.
application
))
...
...
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