From 3271d8df5fd623cbe4485718e87473a728a764eb Mon Sep 17 00:00:00 2001 From: Alexandru Radovici Date: Sat, 21 Aug 2021 21:17:45 +0300 Subject: [PATCH 1/6] fixed kernel version --- .github/workflows/release_clue_nrf52840.yml | 77 ++++++++ .../{release.yml => release_microbit_v2.yml} | 0 .gitignore | 1 - arch/bootloader_cortexm/Cargo.toml | 2 +- boards/clue_nrf52840-bootloader/Cargo.lock | 181 ++++++++++++++++++ boards/clue_nrf52840-bootloader/Cargo.toml | 28 +-- boards/clue_nrf52840-bootloader/src/main.rs | 10 +- boards/microbit_v2-bootloader/Cargo.lock | 28 +-- boards/microbit_v2-bootloader/Cargo.toml | 12 +- boards/nano33ble-bootloader/Cargo.lock | 38 ++-- boards/nano33ble-bootloader/Cargo.toml | 14 +- boards/nano33ble-bootloader/src/main.rs | 10 +- bootloader/Cargo.toml | 2 +- chips/bootloader_nrf52/Cargo.toml | 6 +- protocol/Cargo.lock | 14 ++ 15 files changed, 359 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/release_clue_nrf52840.yml rename .github/workflows/{release.yml => release_microbit_v2.yml} (100%) create mode 100644 boards/clue_nrf52840-bootloader/Cargo.lock create mode 100644 protocol/Cargo.lock diff --git a/.github/workflows/release_clue_nrf52840.yml b/.github/workflows/release_clue_nrf52840.yml new file mode 100644 index 0000000..aee7373 --- /dev/null +++ b/.github/workflows/release_clue_nrf52840.yml @@ -0,0 +1,77 @@ +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: Build elf2uf2 + run: | + apt-get install build-essential cmake + cd /tmp + git clone https://github.com/raspberrypi/pico-sdk.git + cd pico-sdk + git checkout tags/1.2.0 + cd tools/elf2uf2 + mkdir build + cd build + cmake .. + make + cp elf2uf2 /usr/local/bin + - 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 + elf2uf2 target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.bin 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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release_microbit_v2.yml similarity index 100% rename from .github/workflows/release.yml rename to .github/workflows/release_microbit_v2.yml diff --git a/.gitignore b/.gitignore index 098012e..9d665be 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ build target local_cargo -Cargo.lock diff --git a/arch/bootloader_cortexm/Cargo.toml b/arch/bootloader_cortexm/Cargo.toml index 66cda25..a59fe5e 100644 --- a/arch/bootloader_cortexm/Cargo.toml +++ b/arch/bootloader_cortexm/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Tock Project Developers "] [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" } diff --git a/boards/clue_nrf52840-bootloader/Cargo.lock b/boards/clue_nrf52840-bootloader/Cargo.lock new file mode 100644 index 0000000..e37cb50 --- /dev/null +++ b/boards/clue_nrf52840-bootloader/Cargo.lock @@ -0,0 +1,181 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "bootloader" +version = "0.1.0" +dependencies = [ + "kernel", + "tock-bootloader-protocol", +] + +[[package]] +name = "bootloader_attributes" +version = "0.1.0" + +[[package]] +name = "bootloader_cortexm" +version = "0.1.0" +dependencies = [ + "bootloader", + "kernel", +] + +[[package]] +name = "bootloader_nrf52" +version = "0.1.0" +dependencies = [ + "bootloader", + "cortexm4", + "kernel", + "nrf52", +] + +[[package]] +name = "byteorder" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" + +[[package]] +name = "capsules" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" +dependencies = [ + "enum_primitive", + "kernel", + "tickv", +] + +[[package]] +name = "clue_nrf52840-bootloader" +version = "0.1.0" +dependencies = [ + "bootloader", + "bootloader_attributes", + "bootloader_cortexm", + "bootloader_nrf52", + "capsules", + "components", + "cortexm4", + "kernel", + "nrf52", + "nrf52840", + "nrf52_components", +] + +[[package]] +name = "components" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" +dependencies = [ + "capsules", + "kernel", +] + +[[package]] +name = "cortexm" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" +dependencies = [ + "kernel", +] + +[[package]] +name = "cortexm4" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" +dependencies = [ + "cortexm", + "kernel", +] + +[[package]] +name = "enum_primitive" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" + +[[package]] +name = "kernel" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" +dependencies = [ + "tock-cells", + "tock-registers", + "tock-tbf", +] + +[[package]] +name = "nrf52" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" +dependencies = [ + "cortexm4", + "enum_primitive", + "kernel", + "nrf5x", + "tock-rt0", +] + +[[package]] +name = "nrf52840" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" +dependencies = [ + "cortexm4", + "kernel", + "nrf52", + "tock-rt0", +] + +[[package]] +name = "nrf52_components" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" +dependencies = [ + "capsules", + "components", + "cortexm4", + "kernel", + "nrf52", +] + +[[package]] +name = "nrf5x" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" +dependencies = [ + "enum_primitive", + "kernel", +] + +[[package]] +name = "tickv" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" + +[[package]] +name = "tock-bootloader-protocol" +version = "0.2.2" +dependencies = [ + "byteorder", +] + +[[package]] +name = "tock-cells" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" + +[[package]] +name = "tock-registers" +version = "0.6.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" + +[[package]] +name = "tock-rt0" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" + +[[package]] +name = "tock-tbf" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" diff --git a/boards/clue_nrf52840-bootloader/Cargo.toml b/boards/clue_nrf52840-bootloader/Cargo.toml index 185c38d..847d0fb 100644 --- a/boards/clue_nrf52840-bootloader/Cargo.toml +++ b/boards/clue_nrf52840-bootloader/Cargo.toml @@ -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" } diff --git a/boards/clue_nrf52840-bootloader/src/main.rs b/boards/clue_nrf52840-bootloader/src/main.rs index 39222c3..b436497 100644 --- a/boards/clue_nrf52840-bootloader/src/main.rs +++ b/boards/clue_nrf52840-bootloader/src/main.rs @@ -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!( @@ -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))] diff --git a/boards/microbit_v2-bootloader/Cargo.lock b/boards/microbit_v2-bootloader/Cargo.lock index 1c476b4..1b89362 100644 --- a/boards/microbit_v2-bootloader/Cargo.lock +++ b/boards/microbit_v2-bootloader/Cargo.lock @@ -39,7 +39,7 @@ checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" [[package]] name = "capsules" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#e5c422ba232a7e4287b7b72ce5d85e8c41cf6e62" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "enum_primitive", "kernel", @@ -49,7 +49,7 @@ dependencies = [ [[package]] name = "components" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#e5c422ba232a7e4287b7b72ce5d85e8c41cf6e62" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "capsules", "kernel", @@ -58,7 +58,7 @@ dependencies = [ [[package]] name = "cortexm" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#e5c422ba232a7e4287b7b72ce5d85e8c41cf6e62" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "kernel", ] @@ -66,7 +66,7 @@ dependencies = [ [[package]] name = "cortexm4" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#e5c422ba232a7e4287b7b72ce5d85e8c41cf6e62" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "cortexm", "kernel", @@ -75,12 +75,12 @@ dependencies = [ [[package]] name = "enum_primitive" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#e5c422ba232a7e4287b7b72ce5d85e8c41cf6e62" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" [[package]] name = "kernel" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#e5c422ba232a7e4287b7b72ce5d85e8c41cf6e62" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "tock-cells", "tock-registers", @@ -106,7 +106,7 @@ dependencies = [ [[package]] name = "nrf52" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#e5c422ba232a7e4287b7b72ce5d85e8c41cf6e62" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "cortexm4", "enum_primitive", @@ -118,7 +118,7 @@ dependencies = [ [[package]] name = "nrf52833" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#e5c422ba232a7e4287b7b72ce5d85e8c41cf6e62" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "cortexm4", "kernel", @@ -129,7 +129,7 @@ dependencies = [ [[package]] name = "nrf5x" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#e5c422ba232a7e4287b7b72ce5d85e8c41cf6e62" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "enum_primitive", "kernel", @@ -138,7 +138,7 @@ dependencies = [ [[package]] name = "tickv" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#e5c422ba232a7e4287b7b72ce5d85e8c41cf6e62" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" [[package]] name = "tock-bootloader-protocol" @@ -150,19 +150,19 @@ dependencies = [ [[package]] name = "tock-cells" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#e5c422ba232a7e4287b7b72ce5d85e8c41cf6e62" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" [[package]] name = "tock-registers" version = "0.6.0" -source = "git+https://github.com/tock/tock?branch=master#e5c422ba232a7e4287b7b72ce5d85e8c41cf6e62" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" [[package]] name = "tock-rt0" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#e5c422ba232a7e4287b7b72ce5d85e8c41cf6e62" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" [[package]] name = "tock-tbf" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#e5c422ba232a7e4287b7b72ce5d85e8c41cf6e62" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" diff --git a/boards/microbit_v2-bootloader/Cargo.toml b/boards/microbit_v2-bootloader/Cargo.toml index d775e4e..18ae0d6 100644 --- a/boards/microbit_v2-bootloader/Cargo.toml +++ b/boards/microbit_v2-bootloader/Cargo.toml @@ -6,12 +6,12 @@ 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" } -nrf52833 = { git = "https://github.com/tock/tock", branch = "master" } -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" } +nrf52833 = { git = "https://github.com/tock/tock", rev = "405417" } +components = { git = "https://github.com/tock/tock", rev = "405417" } # For Development # cortexm4 = { path = "../../../tock/arch/cortex-m4" } diff --git a/boards/nano33ble-bootloader/Cargo.lock b/boards/nano33ble-bootloader/Cargo.lock index 7bdc9fa..3759d87 100644 --- a/boards/nano33ble-bootloader/Cargo.lock +++ b/boards/nano33ble-bootloader/Cargo.lock @@ -39,16 +39,17 @@ checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" [[package]] name = "capsules" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#75cb55f8e50bb12be1f702128bc369e149a9c0c6" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "enum_primitive", "kernel", + "tickv", ] [[package]] name = "components" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#75cb55f8e50bb12be1f702128bc369e149a9c0c6" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "capsules", "kernel", @@ -57,7 +58,7 @@ dependencies = [ [[package]] name = "cortexm" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#75cb55f8e50bb12be1f702128bc369e149a9c0c6" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "kernel", ] @@ -65,7 +66,7 @@ dependencies = [ [[package]] name = "cortexm4" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#75cb55f8e50bb12be1f702128bc369e149a9c0c6" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "cortexm", "kernel", @@ -74,15 +75,16 @@ dependencies = [ [[package]] name = "enum_primitive" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#75cb55f8e50bb12be1f702128bc369e149a9c0c6" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" [[package]] name = "kernel" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#75cb55f8e50bb12be1f702128bc369e149a9c0c6" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "tock-cells", "tock-registers", + "tock-tbf", ] [[package]] @@ -105,7 +107,7 @@ dependencies = [ [[package]] name = "nrf52" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#75cb55f8e50bb12be1f702128bc369e149a9c0c6" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "cortexm4", "enum_primitive", @@ -117,7 +119,7 @@ dependencies = [ [[package]] name = "nrf52840" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#75cb55f8e50bb12be1f702128bc369e149a9c0c6" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "cortexm4", "kernel", @@ -128,7 +130,7 @@ dependencies = [ [[package]] name = "nrf52_components" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#75cb55f8e50bb12be1f702128bc369e149a9c0c6" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "capsules", "components", @@ -140,12 +142,17 @@ dependencies = [ [[package]] name = "nrf5x" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#75cb55f8e50bb12be1f702128bc369e149a9c0c6" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" dependencies = [ "enum_primitive", "kernel", ] +[[package]] +name = "tickv" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" + [[package]] name = "tock-bootloader-protocol" version = "0.2.2" @@ -156,14 +163,19 @@ dependencies = [ [[package]] name = "tock-cells" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#75cb55f8e50bb12be1f702128bc369e149a9c0c6" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" [[package]] name = "tock-registers" version = "0.6.0" -source = "git+https://github.com/tock/tock?branch=master#75cb55f8e50bb12be1f702128bc369e149a9c0c6" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" [[package]] name = "tock-rt0" version = "0.1.0" -source = "git+https://github.com/tock/tock?branch=master#75cb55f8e50bb12be1f702128bc369e149a9c0c6" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" + +[[package]] +name = "tock-tbf" +version = "0.1.0" +source = "git+https://github.com/tock/tock?rev=405417#40541741703ddddbc14e7a7ef6fca0fb9f0b7584" diff --git a/boards/nano33ble-bootloader/Cargo.toml b/boards/nano33ble-bootloader/Cargo.toml index 952e682..161afd2 100644 --- a/boards/nano33ble-bootloader/Cargo.toml +++ b/boards/nano33ble-bootloader/Cargo.toml @@ -6,13 +6,13 @@ 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" } diff --git a/boards/nano33ble-bootloader/src/main.rs b/boards/nano33ble-bootloader/src/main.rs index 8e23b06..ea1888c 100644 --- a/boards/nano33ble-bootloader/src/main.rs +++ b/boards/nano33ble-bootloader/src/main.rs @@ -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!( @@ -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))] diff --git a/bootloader/Cargo.toml b/bootloader/Cargo.toml index 2245041..b01a20b 100644 --- a/bootloader/Cargo.toml +++ b/bootloader/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Tock Project Developers "] [dependencies] -kernel = { git = "https://github.com/tock/tock", branch = "master" } +kernel = { git = "https://github.com/tock/tock", rev = "405417" } #kernel = { path = "../../tock/kernel" } tock-bootloader-protocol = { path = "../protocol" } diff --git a/chips/bootloader_nrf52/Cargo.toml b/chips/bootloader_nrf52/Cargo.toml index 31d3081..a83f39d 100644 --- a/chips/bootloader_nrf52/Cargo.toml +++ b/chips/bootloader_nrf52/Cargo.toml @@ -4,9 +4,9 @@ version = "0.1.0" authors = ["Tock Project Developers "] [dependencies] -kernel = { git = "https://github.com/tock/tock", branch = "master" } -nrf52 = { git = "https://github.com/tock/tock", branch = "master" } -cortexm4 = { git = "https://github.com/tock/tock", branch = "master" } +kernel = { git = "https://github.com/tock/tock", rev = "405417" } +nrf52 = { git = "https://github.com/tock/tock", rev = "405417" } +cortexm4 = { git = "https://github.com/tock/tock", rev = "405417" } #kernel = { path = "../../../tock/kernel" } #nrf52 = { path = "../../../tock/chips/nrf52" } diff --git a/protocol/Cargo.lock b/protocol/Cargo.lock new file mode 100644 index 0000000..7a88b9e --- /dev/null +++ b/protocol/Cargo.lock @@ -0,0 +1,14 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "byteorder" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" + +[[package]] +name = "tock-bootloader-protocol" +version = "0.2.2" +dependencies = [ + "byteorder", +] From 690bd8840345b9acba65133cf70be2ba19df5811 Mon Sep 17 00:00:00 2001 From: Alexandru Radovici Date: Sat, 21 Aug 2021 21:21:39 +0300 Subject: [PATCH 2/6] update workflow --- .github/workflows/release_clue_nrf52840.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release_clue_nrf52840.yml b/.github/workflows/release_clue_nrf52840.yml index aee7373..6d7e955 100644 --- a/.github/workflows/release_clue_nrf52840.yml +++ b/.github/workflows/release_clue_nrf52840.yml @@ -17,7 +17,7 @@ jobs: - uses: actions-rs/toolchain@v1 # pulls version from rust-toolchain file - name: Build elf2uf2 run: | - apt-get install build-essential cmake + sudo apt-get install -y build-essential cmake cd /tmp git clone https://github.com/raspberrypi/pico-sdk.git cd pico-sdk @@ -27,7 +27,7 @@ jobs: cd build cmake .. make - cp elf2uf2 /usr/local/bin + sudo cp elf2uf2 /usr/local/bin - name: build bootloader run: | cd boards/clue_nrf52840-bootloader From 574a642c0178341bf3dacaa1892ef2532ddd3ad7 Mon Sep 17 00:00:00 2001 From: Alexandru Radovici Date: Sat, 21 Aug 2021 21:25:45 +0300 Subject: [PATCH 3/6] update workflow --- .github/workflows/release_clue_nrf52840.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release_clue_nrf52840.yml b/.github/workflows/release_clue_nrf52840.yml index 6d7e955..24f3252 100644 --- a/.github/workflows/release_clue_nrf52840.yml +++ b/.github/workflows/release_clue_nrf52840.yml @@ -35,7 +35,8 @@ jobs: 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 - elf2uf2 target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.bin target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.uf2 + - name: build uf2 + run: elf2uf2 target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.bin target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.uf2 - name: Version run: | echo "Version: ${{ github.event.inputs.version }}" > tock-bootloader.clue_nrf52840.version From cd6591b6e8acc5d510cf17c32c632fbccf0aba08 Mon Sep 17 00:00:00 2001 From: Alexandru Radovici Date: Sat, 21 Aug 2021 21:28:22 +0300 Subject: [PATCH 4/6] workflow --- .github/workflows/release_clue_nrf52840.yml | 6 +++--- .github/workflows/release_microbit_v2.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release_clue_nrf52840.yml b/.github/workflows/release_clue_nrf52840.yml index 24f3252..9e56fe1 100644 --- a/.github/workflows/release_clue_nrf52840.yml +++ b/.github/workflows/release_clue_nrf52840.yml @@ -28,15 +28,15 @@ jobs: cmake .. make sudo cp elf2uf2 /usr/local/bin - - name: build bootloader + - 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: elf2uf2 target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.bin target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.uf2 + - name: Build uf2 + run: elf2uf2 target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.elf target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.uf2 - name: Version run: | echo "Version: ${{ github.event.inputs.version }}" > tock-bootloader.clue_nrf52840.version diff --git a/.github/workflows/release_microbit_v2.yml b/.github/workflows/release_microbit_v2.yml index 73a73e2..252c62e 100644 --- a/.github/workflows/release_microbit_v2.yml +++ b/.github/workflows/release_microbit_v2.yml @@ -15,7 +15,7 @@ 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 }}" From f435dea1400b75d6a44b3a43e3a413fb6e4341d4 Mon Sep 17 00:00:00 2001 From: Alexandru Radovici Date: Sat, 21 Aug 2021 21:36:35 +0300 Subject: [PATCH 5/6] workflow --- .github/workflows/release_clue_nrf52840.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release_clue_nrf52840.yml b/.github/workflows/release_clue_nrf52840.yml index 9e56fe1..b4f0756 100644 --- a/.github/workflows/release_clue_nrf52840.yml +++ b/.github/workflows/release_clue_nrf52840.yml @@ -15,19 +15,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 # pulls version from rust-toolchain file - - name: Build elf2uf2 - run: | - sudo apt-get install -y build-essential cmake - cd /tmp - git clone https://github.com/raspberrypi/pico-sdk.git - cd pico-sdk - git checkout tags/1.2.0 - cd tools/elf2uf2 - mkdir build - cd build - cmake .. - make - sudo cp elf2uf2 /usr/local/bin + - name: Install elf2uf2 + run: cargo install uf2conv - name: Build bootloader run: | cd boards/clue_nrf52840-bootloader @@ -36,7 +25,7 @@ jobs: 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: elf2uf2 target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.elf target/thumbv7em-none-eabi/release/clue_nrf52840-bootloader.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 From ff3565ef1b8634dd44e2ef4a98b720f187c3012b Mon Sep 17 00:00:00 2001 From: Alexandru Radovici Date: Sat, 21 Aug 2021 22:00:55 +0300 Subject: [PATCH 6/6] update workflow --- .github/workflows/release_microbit_v2.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release_microbit_v2.yml b/.github/workflows/release_microbit_v2.yml index 252c62e..68e3166 100644 --- a/.github/workflows/release_microbit_v2.yml +++ b/.github/workflows/release_microbit_v2.yml @@ -20,14 +20,14 @@ jobs: 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