Merge branch 'master' into algorithm-identifier-openssh
This commit is contained in:
12
.github/workflows/boards_build.yml
vendored
12
.github/workflows/boards_build.yml
vendored
@@ -27,15 +27,11 @@ jobs:
|
|||||||
- name: Set up OpenSK
|
- name: Set up OpenSK
|
||||||
run: ./setup.sh
|
run: ./setup.sh
|
||||||
|
|
||||||
|
- name: Building board nrf52840dk
|
||||||
|
run: ./deploy.py --board=nrf52840dk --no-app --programmer=none
|
||||||
|
- name: Building board nrf52840_dongle
|
||||||
|
run: ./deploy.py --board=nrf52840_dongle --no-app --programmer=none
|
||||||
- name: Building board nrf52840_dongle_dfu
|
- name: Building board nrf52840_dongle_dfu
|
||||||
run: ./deploy.py --board=nrf52840_dongle_dfu --no-app --programmer=none
|
run: ./deploy.py --board=nrf52840_dongle_dfu --no-app --programmer=none
|
||||||
- name: Building board nrf52840_mdk_dfu
|
- name: Building board nrf52840_mdk_dfu
|
||||||
run: ./deploy.py --board=nrf52840_mdk_dfu --no-app --programmer=none
|
run: ./deploy.py --board=nrf52840_mdk_dfu --no-app --programmer=none
|
||||||
|
|
||||||
- name: Create a long build directory
|
|
||||||
run: mkdir this-is-a-long-build-directory-0123456789abcdefghijklmnopqrstuvwxyz && mv third_party this-is-a-long-build-directory-0123456789abcdefghijklmnopqrstuvwxyz/
|
|
||||||
|
|
||||||
- name: Building board nrf52840dk
|
|
||||||
run: make -C this-is-a-long-build-directory-0123456789abcdefghijklmnopqrstuvwxyz/third_party/tock/boards/nordic/nrf52840dk
|
|
||||||
- name: Building board nrf52840_dongle
|
|
||||||
run: make -C this-is-a-long-build-directory-0123456789abcdefghijklmnopqrstuvwxyz/third_party/tock/boards/nordic/nrf52840_dongle
|
|
||||||
|
|||||||
1
.github/workflows/cargo_fmt.yml
vendored
1
.github/workflows/cargo_fmt.yml
vendored
@@ -20,6 +20,7 @@ jobs:
|
|||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
target: thumbv7em-none-eabi
|
target: thumbv7em-none-eabi
|
||||||
|
components: rustfmt
|
||||||
- uses: actions/setup-python@v1
|
- uses: actions/setup-python@v1
|
||||||
with:
|
with:
|
||||||
python-version: 3.7
|
python-version: 3.7
|
||||||
|
|||||||
18
boards/nordic/nrf52840_dongle_dfu/Cargo.toml
Normal file
18
boards/nordic/nrf52840_dongle_dfu/Cargo.toml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
[package]
|
||||||
|
name = "nrf52840_dongle_dfu"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["Tock Project Developers <tock-dev@googlegroups.com>"]
|
||||||
|
build = "build.rs"
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
path = "../nrf52840_dongle/src/main.rs"
|
||||||
|
name = "nrf52840_dongle_dfu"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
components = { path = "../../components" }
|
||||||
|
cortexm4 = { path = "../../../arch/cortex-m4" }
|
||||||
|
capsules = { path = "../../../capsules" }
|
||||||
|
kernel = { path = "../../../kernel" }
|
||||||
|
nrf52840 = { path = "../../../chips/nrf52840" }
|
||||||
|
nrf52dk_base = { path = "../nrf52dk_base" }
|
||||||
@@ -4,7 +4,7 @@ TOCK_ARCH=cortex-m4
|
|||||||
TARGET=thumbv7em-none-eabi
|
TARGET=thumbv7em-none-eabi
|
||||||
PLATFORM=nrf52840_dongle_dfu
|
PLATFORM=nrf52840_dongle_dfu
|
||||||
|
|
||||||
include ../../third_party/tock/boards/Makefile.common
|
include ../../Makefile.common
|
||||||
|
|
||||||
TOCKLOADER=tockloader
|
TOCKLOADER=tockloader
|
||||||
|
|
||||||
@@ -20,10 +20,10 @@ TOCKLOADER_JTAG_FLAGS = --jlink --arch $(TOCK_ARCH) --board $(PLATFORM) --page-s
|
|||||||
|
|
||||||
# Upload the kernel over JTAG
|
# Upload the kernel over JTAG
|
||||||
.PHONY: flash
|
.PHONY: flash
|
||||||
flash: target/$(TARGET)/release/$(PLATFORM).bin
|
flash: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).bin
|
||||||
$(TOCKLOADER) $(TOCKLOADER_GENERAL_FLAGS) flash --address $(KERNEL_ADDRESS) $(TOCKLOADER_JTAG_FLAGS) $<
|
$(TOCKLOADER) $(TOCKLOADER_GENERAL_FLAGS) flash --address $(KERNEL_ADDRESS) $(TOCKLOADER_JTAG_FLAGS) $<
|
||||||
|
|
||||||
# Upload the kernel over serial/bootloader
|
# Upload the kernel over serial/bootloader
|
||||||
.PHONY: program
|
.PHONY: program
|
||||||
program: target/$(TARGET)/release/$(PLATFORM).hex
|
program: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).hex
|
||||||
$(error Cannot program nRF52 Dongle over USB. Use \`make flash\` and JTAG)
|
$(error Cannot program nRF52 Dongle over USB. Use \`make flash\` and JTAG)
|
||||||
4
boards/nordic/nrf52840_dongle_dfu/build.rs
Normal file
4
boards/nordic/nrf52840_dongle_dfu/build.rs
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
fn main() {
|
||||||
|
println!("cargo:rerun-if-changed=layout.ld");
|
||||||
|
println!("cargo:rerun-if-changed=../../kernel_layout.ld");
|
||||||
|
}
|
||||||
@@ -7,4 +7,4 @@ MEMORY
|
|||||||
|
|
||||||
MPU_MIN_ALIGN = 8K;
|
MPU_MIN_ALIGN = 8K;
|
||||||
|
|
||||||
INCLUDE ../../third_party/tock/boards/kernel_layout.ld
|
INCLUDE ../../kernel_layout.ld
|
||||||
14
boards/nordic/nrf52840_mdk_dfu/Cargo.toml
Normal file
14
boards/nordic/nrf52840_mdk_dfu/Cargo.toml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[package]
|
||||||
|
name = "nrf52840_mdk_dfu"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["Yihui Xiong <yihui.xiong@hotmail.com>"]
|
||||||
|
build = "build.rs"
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
components = { path = "../../components" }
|
||||||
|
cortexm4 = { path = "../../../arch/cortex-m4" }
|
||||||
|
capsules = { path = "../../../capsules" }
|
||||||
|
kernel = { path = "../../../kernel" }
|
||||||
|
nrf52840 = { path = "../../../chips/nrf52840" }
|
||||||
|
nrf52dk_base = { path = "../nrf52dk_base" }
|
||||||
@@ -4,7 +4,7 @@ TOCK_ARCH=cortex-m4
|
|||||||
TARGET=thumbv7em-none-eabi
|
TARGET=thumbv7em-none-eabi
|
||||||
PLATFORM=nrf52840_mdk_dfu
|
PLATFORM=nrf52840_mdk_dfu
|
||||||
|
|
||||||
include ../../third_party/tock/boards/Makefile.common
|
include ../../Makefile.common
|
||||||
|
|
||||||
TOCKLOADER=tockloader
|
TOCKLOADER=tockloader
|
||||||
|
|
||||||
@@ -20,10 +20,10 @@ TOCKLOADER_JTAG_FLAGS = --jlink --arch $(TOCK_ARCH) --board $(PLATFORM) --page-s
|
|||||||
|
|
||||||
# Upload the kernel over JTAG
|
# Upload the kernel over JTAG
|
||||||
.PHONY: flash
|
.PHONY: flash
|
||||||
flash: target/$(TARGET)/release/$(PLATFORM).bin
|
flash: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).bin
|
||||||
$(TOCKLOADER) $(TOCKLOADER_GENERAL_FLAGS) flash --address $(KERNEL_ADDRESS) $(TOCKLOADER_JTAG_FLAGS) $<
|
$(TOCKLOADER) $(TOCKLOADER_GENERAL_FLAGS) flash --address $(KERNEL_ADDRESS) $(TOCKLOADER_JTAG_FLAGS) $<
|
||||||
|
|
||||||
# Upload the kernel over serial/bootloader
|
# Upload the kernel over serial/bootloader
|
||||||
.PHONY: program
|
.PHONY: program
|
||||||
program: target/$(TARGET)/release/$(PLATFORM).hex
|
program: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).hex
|
||||||
$(error Cannot program nRF52 Dongle over USB. Use \`make flash\` and JTAG)
|
$(error Cannot program nRF52840-MDK over USB. Use \`make flash\` and JTAG)
|
||||||
4
boards/nordic/nrf52840_mdk_dfu/build.rs
Normal file
4
boards/nordic/nrf52840_mdk_dfu/build.rs
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
fn main() {
|
||||||
|
println!("cargo:rerun-if-changed=layout.ld");
|
||||||
|
println!("cargo:rerun-if-changed=../../kernel_layout.ld");
|
||||||
|
}
|
||||||
@@ -7,4 +7,4 @@ MEMORY
|
|||||||
|
|
||||||
MPU_MIN_ALIGN = 8K;
|
MPU_MIN_ALIGN = 8K;
|
||||||
|
|
||||||
INCLUDE ../../third_party/tock/boards/kernel_layout.ld
|
INCLUDE ../../kernel_layout.ld
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "nrf52840_dongle_dfu"
|
|
||||||
version = "0.1.0"
|
|
||||||
authors = ["Tock Project Developers <tock-dev@googlegroups.com>"]
|
|
||||||
build = "build.rs"
|
|
||||||
edition = "2018"
|
|
||||||
|
|
||||||
[profile.dev]
|
|
||||||
panic = "abort"
|
|
||||||
lto = false
|
|
||||||
opt-level = "z"
|
|
||||||
debug = true
|
|
||||||
|
|
||||||
[profile.release]
|
|
||||||
panic = "abort"
|
|
||||||
lto = true
|
|
||||||
opt-level = "z"
|
|
||||||
debug = true
|
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
path = "../../third_party/tock/boards/nordic/nrf52840_dongle/src/main.rs"
|
|
||||||
name = "nrf52840_dongle_dfu"
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
components = { path = "../../third_party/tock/boards/components" }
|
|
||||||
cortexm4 = { path = "../../third_party/tock/arch/cortex-m4" }
|
|
||||||
capsules = { path = "../../third_party/tock/capsules" }
|
|
||||||
kernel = { path = "../../third_party/tock/kernel" }
|
|
||||||
nrf52840 = { path = "../../third_party/tock/chips/nrf52840" }
|
|
||||||
nrf52dk_base = { path = "../../third_party/tock/boards/nordic/nrf52dk_base" }
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
fn main() {
|
|
||||||
println!("cargo:rerun-if-changed=layout.ld");
|
|
||||||
println!("cargo:rerun-if-changed=../../third_party/tock/boards/kernel_layout.ld");
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "nrf52840_mdk_dfu"
|
|
||||||
version = "0.1.0"
|
|
||||||
authors = ["Yihui Xiong <yihui.xiong@hotmail.com>"]
|
|
||||||
build = "build.rs"
|
|
||||||
edition = "2018"
|
|
||||||
|
|
||||||
[profile.dev]
|
|
||||||
panic = "abort"
|
|
||||||
lto = false
|
|
||||||
opt-level = "z"
|
|
||||||
debug = true
|
|
||||||
|
|
||||||
[profile.release]
|
|
||||||
panic = "abort"
|
|
||||||
lto = true
|
|
||||||
opt-level = "z"
|
|
||||||
debug = true
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
components = { path = "../../third_party/tock/boards/components" }
|
|
||||||
cortexm4 = { path = "../../third_party/tock/arch/cortex-m4" }
|
|
||||||
capsules = { path = "../../third_party/tock/capsules" }
|
|
||||||
kernel = { path = "../../third_party/tock/kernel" }
|
|
||||||
nrf52840 = { path = "../../third_party/tock/chips/nrf52840" }
|
|
||||||
nrf52dk_base = { path = "../../third_party/tock/boards/nordic/nrf52dk_base" }
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
fn main() {
|
|
||||||
println!("cargo:rerun-if-changed=layout.ld");
|
|
||||||
println!("cargo:rerun-if-changed=../../third_party/tock/boards/kernel_layout.ld");
|
|
||||||
}
|
|
||||||
17
deploy.py
17
deploy.py
@@ -115,7 +115,7 @@ SUPPORTED_BOARDS = {
|
|||||||
),
|
),
|
||||||
"nrf52840_dongle_dfu":
|
"nrf52840_dongle_dfu":
|
||||||
OpenSKBoard(
|
OpenSKBoard(
|
||||||
path="boards/nrf52840_dongle_dfu",
|
path="third_party/tock/boards/nordic/nrf52840_dongle_dfu",
|
||||||
arch="thumbv7em-none-eabi",
|
arch="thumbv7em-none-eabi",
|
||||||
page_size=4096,
|
page_size=4096,
|
||||||
kernel_address=0x1000,
|
kernel_address=0x1000,
|
||||||
@@ -132,7 +132,7 @@ SUPPORTED_BOARDS = {
|
|||||||
),
|
),
|
||||||
"nrf52840_mdk_dfu":
|
"nrf52840_mdk_dfu":
|
||||||
OpenSKBoard(
|
OpenSKBoard(
|
||||||
path="boards/nrf52840_mdk_dfu",
|
path="third_party/tock/boards/nordic/nrf52840_mdk_dfu",
|
||||||
arch="thumbv7em-none-eabi",
|
arch="thumbv7em-none-eabi",
|
||||||
page_size=4096,
|
page_size=4096,
|
||||||
kernel_address=0x1000,
|
kernel_address=0x1000,
|
||||||
@@ -304,7 +304,8 @@ class OpenSKInstaller:
|
|||||||
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("third_party", "tock", "target", props.arch,
|
||||||
|
"release")
|
||||||
os.makedirs(out_directory, exist_ok=True)
|
os.makedirs(out_directory, exist_ok=True)
|
||||||
self.checked_command_output(["make"], cwd=props.path)
|
self.checked_command_output(["make"], cwd=props.path)
|
||||||
|
|
||||||
@@ -418,8 +419,9 @@ class OpenSKInstaller:
|
|||||||
|
|
||||||
def install_tock_os(self):
|
def install_tock_os(self):
|
||||||
board_props = SUPPORTED_BOARDS[self.args.board]
|
board_props = SUPPORTED_BOARDS[self.args.board]
|
||||||
kernel_file = os.path.join(board_props.path, "target", board_props.arch,
|
kernel_file = os.path.join("third_party", "tock", "target",
|
||||||
"release", "{}.bin".format(self.args.board))
|
board_props.arch, "release",
|
||||||
|
"{}.bin".format(self.args.board))
|
||||||
info("Flashing file {}.".format(kernel_file))
|
info("Flashing file {}.".format(kernel_file))
|
||||||
with open(kernel_file, "rb") as f:
|
with open(kernel_file, "rb") as f:
|
||||||
kernel = f.read()
|
kernel = f.read()
|
||||||
@@ -481,8 +483,9 @@ class OpenSKInstaller:
|
|||||||
|
|
||||||
if self.args.tockos:
|
if self.args.tockos:
|
||||||
# Process kernel
|
# Process kernel
|
||||||
kernel_path = os.path.join(board_props.path, "target", board_props.arch,
|
kernel_path = os.path.join("third_party", "tock", "target",
|
||||||
"release", "{}.bin".format(self.args.board))
|
board_props.arch, "release",
|
||||||
|
"{}.bin".format(self.args.board))
|
||||||
with open(kernel_path, "rb") as kernel:
|
with open(kernel_path, "rb") as kernel:
|
||||||
kern_hex = intelhex.IntelHex()
|
kern_hex = intelhex.IntelHex()
|
||||||
kern_hex.frombytes(kernel.read(), offset=board_props.kernel_address)
|
kern_hex.frombytes(kernel.read(), offset=board_props.kernel_address)
|
||||||
|
|||||||
13
patches/tock/04-additional-boards.patch
Normal file
13
patches/tock/04-additional-boards.patch
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/Cargo.toml b/Cargo.toml
|
||||||
|
index 18f4a10d..db88dc1d 100644
|
||||||
|
--- a/Cargo.toml
|
||||||
|
+++ b/Cargo.toml
|
||||||
|
@@ -13,6 +13,8 @@ members = [
|
||||||
|
"boards/launchxl",
|
||||||
|
"boards/nordic/nrf52840dk",
|
||||||
|
"boards/nordic/nrf52840_dongle",
|
||||||
|
+ "boards/nordic/nrf52840_dongle_dfu",
|
||||||
|
+ "boards/nordic/nrf52840_mdk_dfu",
|
||||||
|
"boards/nordic/nrf52dk",
|
||||||
|
"boards/nucleo_f429zi",
|
||||||
|
"boards/nucleo_f446re",
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
diff --git a/chips/nrf52/src/crt1.rs b/chips/nrf52/src/crt1.rs
|
|
||||||
index 9703aac..281ceeb 100644
|
|
||||||
--- a/chips/nrf52/src/crt1.rs
|
|
||||||
+++ b/chips/nrf52/src/crt1.rs
|
|
||||||
@@ -1,4 +1,4 @@
|
|
||||||
-use cortexm4::{generic_isr, hard_fault_handler, nvic, svc_handler, systick_handler};
|
|
||||||
+use cortexm4::{generic_isr, hard_fault_handler, nvic, scb, svc_handler, systick_handler};
|
|
||||||
use tock_rt0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
@@ -168,5 +168,9 @@ pub unsafe extern "C" fn init() {
|
|
||||||
tock_rt0::init_data(&mut _etext, &mut _srelocate, &mut _erelocate);
|
|
||||||
tock_rt0::zero_bss(&mut _szero, &mut _ezero);
|
|
||||||
|
|
||||||
+ // Ensure that we are compatible with a bootloader.
|
|
||||||
+ // For this we need to offset our vector table
|
|
||||||
+ scb::set_vector_table_offset(BASE_VECTORS.as_ptr() as *const ());
|
|
||||||
+
|
|
||||||
nvic::enable_all();
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -50,8 +50,16 @@ make -C third_party/tock/boards/nordic/nrf52840dk
|
|||||||
make -C third_party/tock/boards/nordic/nrf52840_dongle
|
make -C third_party/tock/boards/nordic/nrf52840_dongle
|
||||||
|
|
||||||
echo "Checking that other boards build properly..."
|
echo "Checking that other boards build properly..."
|
||||||
make -C boards/nrf52840_dongle_dfu
|
make -C third_party/tock/boards/nordic/nrf52840_dongle_dfu
|
||||||
make -C boards/nrf52840_mdk_dfu
|
make -C third_party/tock/boards/nordic/nrf52840_mdk_dfu
|
||||||
|
|
||||||
|
echo "Checking deployment of supported boards..."
|
||||||
|
./deploy.py --board=nrf52840dk --no-app --programmer=none
|
||||||
|
./deploy.py --board=nrf52840_dongle --no-app --programmer=none
|
||||||
|
|
||||||
|
echo "Checking deployment of other boards..."
|
||||||
|
./deploy.py --board=nrf52840_dongle_dfu --no-app --programmer=none
|
||||||
|
./deploy.py --board=nrf52840_mdk_dfu --no-app --programmer=none
|
||||||
|
|
||||||
if [ -z "${TRAVIS_OS_NAME}" -o "${TRAVIS_OS_NAME}" = "linux" ]
|
if [ -z "${TRAVIS_OS_NAME}" -o "${TRAVIS_OS_NAME}" = "linux" ]
|
||||||
then
|
then
|
||||||
|
|||||||
5
setup.sh
5
setup.sh
@@ -46,6 +46,11 @@ EOF
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Copy additional boards to the kernel.
|
||||||
|
echo -n '[-] Copying additional boards to Tock... '
|
||||||
|
cp -r boards/* third_party/tock/boards
|
||||||
|
echo $done_text
|
||||||
|
|
||||||
# Apply patches to kernel. Do that in a sub-shell
|
# Apply patches to kernel. Do that in a sub-shell
|
||||||
(
|
(
|
||||||
cd third_party/tock/ && \
|
cd third_party/tock/ && \
|
||||||
|
|||||||
2
third_party/tock
vendored
2
third_party/tock
vendored
Submodule third_party/tock updated: 3139864d39...ba44dd690f
Reference in New Issue
Block a user