Skip to content

Commit 7062d74

Browse files
authored
Merge pull request #25 from WyliodrinEmbeddedIoT/kernel_version
Fixed tock version and workflow
2 parents aedb2fb + ff3565e commit 7062d74

File tree

15 files changed

+352
-67
lines changed

15 files changed

+352
-67
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CLUE nRF52840 Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version'
8+
required: true
9+
10+
jobs:
11+
release:
12+
runs-on: "ubuntu-latest"
13+
14+
# Steps represent a sequence of tasks that will be executed as part of the job
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions-rs/toolchain@v1 # pulls version from rust-toolchain file
18+
- name: Install elf2uf2
19+
run: cargo install uf2conv
20+
- name: Build bootloader
21+
run: |
22+
cd boards/clue_nrf52840-bootloader
23+
export BOOTLOADER_VERSION="${{ github.event.inputs.version }}"
24+
export BOOTLOADER_HASH="$(git rev-parse HEAD)"
25+
export BOOTLOADER_KERNEL_HASH="$(cat Cargo.lock | grep https://github.com/tock/tock?rev=405417 | uniq | cut -d '#' -f 2 | cut -d '"' -f 1)"
26+
make
27+
- name: Build uf2
28+
run: uf2conv target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.bin -f 0xADA52840 --base 0x26000 --output target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.uf2
29+
- name: Version
30+
run: |
31+
echo "Version: ${{ github.event.inputs.version }}" > tock-bootloader.clue_nrf52840.version
32+
echo "Toolchain: $(rustc --version)" >> tock-bootloader.clue_nrf52840.version
33+
echo "Tock Bootloader Hash: $(git rev-parse HEAD)" >> tock-bootloader.clue_nrf52840.version
34+
echo Tock Hash: $(cat boards/clue_nrf52840-bootloader/Cargo.lock | grep https://github.com/tock/tock?rev=405417 | uniq | cut -d '#' -f 2 | cut -d '"' -f 1) >> tock-bootloader.clue_nrf52840.version
35+
echo "Bootloader SHA256: $(sha256sum target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.bin | cut -d ' ' -f 1)" >> tock-bootloader.clue_nrf52840.version
36+
echo "Build Date: $(date)" >> tock-bootloader.clue_nrf52840.version
37+
- name: Upload bootloader release
38+
uses: svenstaro/upload-release-action@v2
39+
with:
40+
release_name: CLUE nRF52840 Express ${{ github.event.inputs.version }}
41+
prerelease: true
42+
repo_token: ${{ secrets.GITHUB_TOKEN }}
43+
file: target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.bin
44+
asset_name: tock-bootloader.clue_nrf52840.${{ github.event.inputs.version }}.bin
45+
tag: clue_nrf52840-${{ github.event.inputs.version }}
46+
overwrite: true
47+
body: "Bootloader for CLUE nRF52840 Express ${{ github.event.inputs.version }}"
48+
- name: Upload bootloader uf2
49+
uses: svenstaro/upload-release-action@v2
50+
with:
51+
release_name: CLUE nRF52840 Express ${{ github.event.inputs.version }}
52+
prerelease: true
53+
repo_token: ${{ secrets.GITHUB_TOKEN }}
54+
file: target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.uf2
55+
asset_name: tock-bootloader.clue_nrf52840.${{ github.event.inputs.version }}.uf2
56+
tag: clue_nrf52840-${{ github.event.inputs.version }}
57+
overwrite: true
58+
body: "Bootloader for CLUE nRF52840 Express ${{ github.event.inputs.version }}"
59+
- name: Upload bootloader version
60+
uses: svenstaro/upload-release-action@v2
61+
with:
62+
release_name: CLUE nRF52840 Express ${{ github.event.inputs.version }}
63+
prerelease: true
64+
repo_token: ${{ secrets.GITHUB_TOKEN }}
65+
file: tock-bootloader.clue_nrf52840.version
66+
asset_name: tock-bootloader.clue_nrf52840.${{ github.event.inputs.version }}.version
67+
tag: clue_nrf52840-${{ github.event.inputs.version }}

.github/workflows/release.yml renamed to .github/workflows/release_microbit_v2.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v2
1717
- uses: actions-rs/toolchain@v1 # pulls version from rust-toolchain file
18-
- name: build bootloader
18+
- name: Build bootloader
1919
run: |
2020
cd boards/microbit_v2-bootloader
2121
export BOOTLOADER_VERSION="${{ github.event.inputs.version }}"
2222
export BOOTLOADER_HASH="$(git rev-parse HEAD)"
23-
export BOOTLOADER_KERNEL_HASH="$(cat Cargo.lock | grep https://github.com/tock/tock?branch=remove-submodule | uniq | cut -d '#' -f 2 | cut -d '"' -f 1)"
23+
export BOOTLOADER_KERNEL_HASH="$(cat Cargo.lock | grep https://github.com/tock/tock?branch=rev=405417 | uniq | cut -d '#' -f 2 | cut -d '"' -f 1)"
2424
make
2525
- name: Version
2626
run: |
2727
echo "Version: ${{ github.event.inputs.version }}" > tock-bootloader.microbit_v2.version
2828
echo "Toolchain: $(rustc --version)" >> tock-bootloader.microbit_v2.version
2929
echo "Tock Bootloader Hash: $(git rev-parse HEAD)" >> tock-bootloader.microbit_v2.version
30-
echo Tock Hash: $(cat boards/microbit_v2-bootloader/Cargo.lock | grep https://github.com/tock/tock?branch=remove-submodule | uniq | cut -d '#' -f 2 | cut -d '"' -f 1) >> tock-bootloader.microbit_v2.version
30+
echo Tock Hash: $(cat boards/microbit_v2-bootloader/Cargo.lock | grep https://github.com/tock/tock?branch=rev=405417 | uniq | cut -d '#' -f 2 | cut -d '"' -f 1) >> tock-bootloader.microbit_v2.version
3131
echo "Bootloader SHA256: $(sha256sum target/thumbv7em-none-eabi/release/microbit_v2-bootloader.bin | cut -d ' ' -f 1)" >> tock-bootloader.microbit_v2.version
3232
echo "Build Date: $(date)" >> tock-bootloader.microbit_v2.version
3333
- name: Upload bootloader release

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
build
22
target
33
local_cargo
4-
Cargo.lock
54

arch/bootloader_cortexm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Tock Project Developers <[email protected]>"]
55

66
[dependencies]
7-
kernel = { git = "https://github.com/tock/tock", branch = "master" }
7+
kernel = { git = "https://github.com/tock/tock", rev = "405417" }
88
#kernel = { path = "../../../tock/kernel" }
99

1010
bootloader = { path = "../../bootloader" }

boards/clue_nrf52840-bootloader/Cargo.lock

Lines changed: 181 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

boards/clue_nrf52840-bootloader/Cargo.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ build = "build.rs"
66
edition = "2018"
77

88
[dependencies]
9-
# cortexm4 = { git = "https://github.com/tock/tock", branch = "master" }
10-
# capsules = { git = "https://github.com/tock/tock", branch = "master" }
11-
# kernel = { git = "https://github.com/tock/tock", branch = "master" }
12-
# nrf52 = { git = "https://github.com/tock/tock", branch = "master" }
13-
# nrf52840 = { git = "https://github.com/tock/tock", branch = "master" }
14-
# components = { git = "https://github.com/tock/tock", branch = "master" }
15-
# nrf52_components = { git = "https://github.com/tock/tock", branch = "master" }
9+
cortexm4 = { git = "https://github.com/tock/tock", rev = "405417" }
10+
capsules = { git = "https://github.com/tock/tock", rev = "405417" }
11+
kernel = { git = "https://github.com/tock/tock", rev = "405417" }
12+
nrf52 = { git = "https://github.com/tock/tock", rev = "405417" }
13+
nrf52840 = { git = "https://github.com/tock/tock", rev = "405417" }
14+
components = { git = "https://github.com/tock/tock", rev = "405417" }
15+
nrf52_components = { git = "https://github.com/tock/tock", rev = "405417" }
1616

1717
# For Development
18-
cortexm4 = { path = "../../../tock/arch/cortex-m4" }
19-
capsules = { path = "../../../tock/capsules" }
20-
kernel = { path = "../../../tock/kernel" }
21-
nrf52 = { path = "../../../tock/chips/nrf52" }
22-
nrf52840 = { path = "../../../tock/chips/nrf52840" }
23-
components = { path = "../../../tock/boards/components" }
24-
nrf52_components = { path = "../../../tock/boards/nordic/nrf52_components" }
18+
# cortexm4 = { path = "../../../tock/arch/cortex-m4" }
19+
# capsules = { path = "../../../tock/capsules" }
20+
# kernel = { path = "../../../tock/kernel" }
21+
# nrf52 = { path = "../../../tock/chips/nrf52" }
22+
# nrf52840 = { path = "../../../tock/chips/nrf52840" }
23+
# components = { path = "../../../tock/boards/components" }
24+
# nrf52_components = { path = "../../../tock/boards/nordic/nrf52_components" }
2525

2626
bootloader = { path = "../../bootloader" }
2727
bootloader_nrf52 = { path = "../../chips/bootloader_nrf52" }

boards/clue_nrf52840-bootloader/src/main.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub unsafe fn reset_handler() {
117117

118118
let active_notifier_led = static_init!(
119119
kernel::hil::led::LedHigh<'static, nrf52840::gpio::GPIOPin>,
120-
kernel::hil::led::LedHigh::new(&base_peripherals.gpio_port[LED_ON_PIN])
120+
kernel::hil::led::LedHigh::new(&nrf52840_peripherals.gpio_port[LED_ON_PIN])
121121
);
122122

123123
let bootloader_active_notifier = static_init!(
@@ -387,7 +387,13 @@ pub unsafe fn reset_handler() {
387387

388388
let scheduler = components::sched::round_robin::RoundRobinComponent::new(&PROCESSES)
389389
.finalize(components::rr_component_helper!(NUM_PROCS));
390-
board_kernel.kernel_loop(&platform, chip, None, scheduler, &main_loop_capability);
390+
board_kernel.kernel_loop::<_, _, _, NUM_PROCS>(
391+
&platform,
392+
chip,
393+
None,
394+
scheduler,
395+
&main_loop_capability,
396+
);
391397
}
392398

393399
#[cfg(not(test))]

0 commit comments

Comments
 (0)