Skip to content

Commit

Permalink
Merge pull request #25 from WyliodrinEmbeddedIoT/kernel_version
Browse files Browse the repository at this point in the history
Fixed tock version and workflow
  • Loading branch information
bradjc authored Aug 24, 2021
2 parents aedb2fb + ff3565e commit 7062d74
Show file tree
Hide file tree
Showing 15 changed files with 352 additions and 67 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/release_clue_nrf52840.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CLUE nRF52840 Release

on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true

jobs:
release:
runs-on: "ubuntu-latest"

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1 # pulls version from rust-toolchain file
- name: Install elf2uf2
run: cargo install uf2conv
- name: Build bootloader
run: |
cd boards/clue_nrf52840-bootloader
export BOOTLOADER_VERSION="${{ github.event.inputs.version }}"
export BOOTLOADER_HASH="$(git rev-parse HEAD)"
export BOOTLOADER_KERNEL_HASH="$(cat Cargo.lock | grep https://github.com/tock/tock?rev=405417 | uniq | cut -d '#' -f 2 | cut -d '"' -f 1)"
make
- name: Build uf2
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
- name: Version
run: |
echo "Version: ${{ github.event.inputs.version }}" > tock-bootloader.clue_nrf52840.version
echo "Toolchain: $(rustc --version)" >> tock-bootloader.clue_nrf52840.version
echo "Tock Bootloader Hash: $(git rev-parse HEAD)" >> tock-bootloader.clue_nrf52840.version
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
echo "Bootloader SHA256: $(sha256sum target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.bin | cut -d ' ' -f 1)" >> tock-bootloader.clue_nrf52840.version
echo "Build Date: $(date)" >> tock-bootloader.clue_nrf52840.version
- name: Upload bootloader release
uses: svenstaro/upload-release-action@v2
with:
release_name: CLUE nRF52840 Express ${{ github.event.inputs.version }}
prerelease: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.bin
asset_name: tock-bootloader.clue_nrf52840.${{ github.event.inputs.version }}.bin
tag: clue_nrf52840-${{ github.event.inputs.version }}
overwrite: true
body: "Bootloader for CLUE nRF52840 Express ${{ github.event.inputs.version }}"
- name: Upload bootloader uf2
uses: svenstaro/upload-release-action@v2
with:
release_name: CLUE nRF52840 Express ${{ github.event.inputs.version }}
prerelease: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.uf2
asset_name: tock-bootloader.clue_nrf52840.${{ github.event.inputs.version }}.uf2
tag: clue_nrf52840-${{ github.event.inputs.version }}
overwrite: true
body: "Bootloader for CLUE nRF52840 Express ${{ github.event.inputs.version }}"
- name: Upload bootloader version
uses: svenstaro/upload-release-action@v2
with:
release_name: CLUE nRF52840 Express ${{ github.event.inputs.version }}
prerelease: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: tock-bootloader.clue_nrf52840.version
asset_name: tock-bootloader.clue_nrf52840.${{ github.event.inputs.version }}.version
tag: clue_nrf52840-${{ github.event.inputs.version }}
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1 # pulls version from rust-toolchain file
- name: build bootloader
- name: Build bootloader
run: |
cd boards/microbit_v2-bootloader
export BOOTLOADER_VERSION="${{ github.event.inputs.version }}"
export BOOTLOADER_HASH="$(git rev-parse HEAD)"
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)"
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)"
make
- name: Version
run: |
echo "Version: ${{ github.event.inputs.version }}" > tock-bootloader.microbit_v2.version
echo "Toolchain: $(rustc --version)" >> tock-bootloader.microbit_v2.version
echo "Tock Bootloader Hash: $(git rev-parse HEAD)" >> tock-bootloader.microbit_v2.version
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
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
echo "Bootloader SHA256: $(sha256sum target/thumbv7em-none-eabi/release/microbit_v2-bootloader.bin | cut -d ' ' -f 1)" >> tock-bootloader.microbit_v2.version
echo "Build Date: $(date)" >> tock-bootloader.microbit_v2.version
- name: Upload bootloader release
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
build
target
local_cargo
Cargo.lock

2 changes: 1 addition & 1 deletion arch/bootloader_cortexm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Tock Project Developers <[email protected]>"]

[dependencies]
kernel = { git = "https://github.com/tock/tock", branch = "master" }
kernel = { git = "https://github.com/tock/tock", rev = "405417" }
#kernel = { path = "../../../tock/kernel" }

bootloader = { path = "../../bootloader" }
181 changes: 181 additions & 0 deletions boards/clue_nrf52840-bootloader/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions boards/clue_nrf52840-bootloader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ build = "build.rs"
edition = "2018"

[dependencies]
# cortexm4 = { git = "https://github.com/tock/tock", branch = "master" }
# capsules = { git = "https://github.com/tock/tock", branch = "master" }
# kernel = { git = "https://github.com/tock/tock", branch = "master" }
# nrf52 = { git = "https://github.com/tock/tock", branch = "master" }
# nrf52840 = { git = "https://github.com/tock/tock", branch = "master" }
# components = { git = "https://github.com/tock/tock", branch = "master" }
# nrf52_components = { git = "https://github.com/tock/tock", branch = "master" }
cortexm4 = { git = "https://github.com/tock/tock", rev = "405417" }
capsules = { git = "https://github.com/tock/tock", rev = "405417" }
kernel = { git = "https://github.com/tock/tock", rev = "405417" }
nrf52 = { git = "https://github.com/tock/tock", rev = "405417" }
nrf52840 = { git = "https://github.com/tock/tock", rev = "405417" }
components = { git = "https://github.com/tock/tock", rev = "405417" }
nrf52_components = { git = "https://github.com/tock/tock", rev = "405417" }

# For Development
cortexm4 = { path = "../../../tock/arch/cortex-m4" }
capsules = { path = "../../../tock/capsules" }
kernel = { path = "../../../tock/kernel" }
nrf52 = { path = "../../../tock/chips/nrf52" }
nrf52840 = { path = "../../../tock/chips/nrf52840" }
components = { path = "../../../tock/boards/components" }
nrf52_components = { path = "../../../tock/boards/nordic/nrf52_components" }
# cortexm4 = { path = "../../../tock/arch/cortex-m4" }
# capsules = { path = "../../../tock/capsules" }
# kernel = { path = "../../../tock/kernel" }
# nrf52 = { path = "../../../tock/chips/nrf52" }
# nrf52840 = { path = "../../../tock/chips/nrf52840" }
# components = { path = "../../../tock/boards/components" }
# nrf52_components = { path = "../../../tock/boards/nordic/nrf52_components" }

bootloader = { path = "../../bootloader" }
bootloader_nrf52 = { path = "../../chips/bootloader_nrf52" }
Expand Down
10 changes: 8 additions & 2 deletions boards/clue_nrf52840-bootloader/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub unsafe fn reset_handler() {

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

let bootloader_active_notifier = static_init!(
Expand Down Expand Up @@ -387,7 +387,13 @@ pub unsafe fn reset_handler() {

let scheduler = components::sched::round_robin::RoundRobinComponent::new(&PROCESSES)
.finalize(components::rr_component_helper!(NUM_PROCS));
board_kernel.kernel_loop(&platform, chip, None, scheduler, &main_loop_capability);
board_kernel.kernel_loop::<_, _, _, NUM_PROCS>(
&platform,
chip,
None,
scheduler,
&main_loop_capability,
);
}

#[cfg(not(test))]
Expand Down
Loading

0 comments on commit 7062d74

Please sign in to comment.