Skip to content

Commit

Permalink
Add Cortex-R5 on ThreadX demo.
Browse files Browse the repository at this point in the history
Currently there's no timer interrupt, so the tasks hang. But it does boot.
  • Loading branch information
jonathanpallant committed Jul 22, 2024
1 parent af12ba2 commit 963a5ee
Show file tree
Hide file tree
Showing 20 changed files with 1,623 additions and 25 deletions.
44 changes: 41 additions & 3 deletions .github/workflows/build-ferrocene.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on: [push]
jobs:
job-build-nrf52-app:
runs-on: ubuntu-latest
needs: job-build-threadx-staticlib
steps:
- name: Install Arm C compiler
run: |
Expand All @@ -28,13 +27,13 @@ jobs:
slug=$(./describe.sh "${GITHUB_REF}")
echo "Building with slug '${slug}'"
echo "BUILD_SLUG=${slug}" >> "${GITHUB_ENV}"
- name: Check Demo App
- name: Check nRF52 App
run: |
cd nrf52-app
rustc --version
cargo --version
cargo check --target=thumbv7em-none-eabi
- name: Build Demo App
- name: Build nRF52 App
run: |
cd nrf52-app
rustc --version
Expand All @@ -45,6 +44,45 @@ jobs:
with:
name: nrf52-app
path: nrf52-app/target/thumbv7em-none-eabi/release/nrf52-app
job-build-qemu-cortex-r5-app:
runs-on: ubuntu-latest
steps:
- name: Install Arm C compiler
run: |
sudo apt-get update -y && sudo apt-get -y install gcc-arm-none-eabi
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/ferrocene/criticalup/releases/download/v1.0.0-prerelease.1/criticalup-installer.sh | sh
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install Ferrocene
env:
CRITICALUP_TOKEN: ${{ secrets.CRITICALUP_TOKEN }}
run: |
criticalup install
echo "$HOME/.local/share/criticalup/bin" >> $GITHUB_PATH
- name: Find slug name
run: |
slug=$(./describe.sh "${GITHUB_REF}")
echo "Building with slug '${slug}'"
echo "BUILD_SLUG=${slug}" >> "${GITHUB_ENV}"
- name: Check QEMU Cortex-R5 App
run: |
cd qemu-cortex-r5-app
rustc --version
cargo --version
cargo check --target=armv7r-none-eabihf
- name: Build QEMU Cortex-R5 App
run: |
cd qemu-cortex-r5-app
rustc --version
cargo --version
cargo build --target=armv7r-none-eabihf --release
- name: Upload QEMU Cortex-R5 App
uses: actions/upload-artifact@master
with:
name: qemu-cortex-r5-app
path: qemu-cortex-r5-app/target/armv7r-none-eabihf/release/qemu-cortex-r5-app
job-build-threadx-sys:
runs-on: ubuntu-latest
steps:
Expand Down
36 changes: 33 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on: [push]
jobs:
job-build-nrf52-app:
runs-on: ubuntu-latest
needs: job-build-threadx-staticlib
steps:
- name: Install Arm C compiler
run: |
Expand All @@ -28,11 +27,11 @@ jobs:
slug=$(./describe.sh "${GITHUB_REF}")
echo "Building with slug '${slug}'"
echo "BUILD_SLUG=${slug}" >> "${GITHUB_ENV}"
- name: Check Demo App
- name: Check nRF52 App
run: |
cd nrf52-app
cargo check --target=thumbv7em-none-eabi
- name: Build Demo App
- name: Build nRF52 App
run: |
cd nrf52-app
cargo build --target=thumbv7em-none-eabi --release
Expand All @@ -41,6 +40,37 @@ jobs:
with:
name: nrf52-app
path: nrf52-app/target/thumbv7em-none-eabi/release/nrf52-app
job-build-qemu-cortex-r5-app:
runs-on: ubuntu-latest
steps:
- name: Install Arm C compiler
run: |
sudo apt-get update -y && sudo apt-get -y install gcc-arm-none-eabi
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Add rustup target
run: |
rustup target add armv7r-none-eabihf
- name: Find slug name
run: |
slug=$(./describe.sh "${GITHUB_REF}")
echo "Building with slug '${slug}'"
echo "BUILD_SLUG=${slug}" >> "${GITHUB_ENV}"
- name: Check QEMU Cortex-R5 App
run: |
cd qemu-cortex-r5-app
cargo check --target=armv7r-none-eabihf
- name: Build QEMU Cortex-R5 App
run: |
cd qemu-cortex-r5-app
cargo build --target=armv7r-none-eabihf --release
- name: Upload qemu-cortex-r5-app
uses: actions/upload-artifact@master
with:
name: qemu-cortex-r5-app
path: qemu-cortex-r5-app/target/armv7r-none-eabihf/release/qemu-cortex-r5-app
job-build-threadx-sys:
runs-on: ubuntu-latest
steps:
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,31 @@ jobs:
- name: Add rustup target
run: |
rustup target add thumbv7em-none-eabi
- name: Check Clippy on Demo App
- name: Check Clippy on nRF52 App
env:
RUSTFLAGS: "-Dwarnings"
run: |
cd nrf52-app
cargo clippy --all-features
job-clippy-qemu-cortex-r5-app:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install tools
run: |
sudo apt-get update -y && sudo apt-get -y install gcc-arm-none-eabi
- name: Add rustup target
run: |
rustup target add armv7r-none-eabihf
- name: Check Clippy on QEMU Cortex-R5 App
env:
RUSTFLAGS: "-Dwarnings"
run: |
cd qemu-cortex-r5-app
cargo clippy --all-features
job-clippy-threadx-sys:
runs-on: ubuntu-latest
steps:
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Check Formatting
- name: Check Formatting on nRF52 App
run: |
cd nrf52-app
cargo fmt -- --check
job-format-qemu-cortex-r5-app:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Check Formatting on QEMU Cortex-R5 App
run: |
cd qemu-cortex-r5-app
cargo fmt -- --check
job-format-threadx-sys:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ set -euo pipefail
pushd nrf52-app
cargo build --release
popd

pushd qemu-cortex-r5-app
cargo build --release
popd
1 change: 1 addition & 0 deletions criticalup.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ packages = [
"flip-link-${rustc-host}",
"llvm-tools-${rustc-host}",
"rust-std-thumbv7em-none-eabi",
"rust-std-armv7r-none-eabihf",
]
34 changes: 17 additions & 17 deletions nrf52-app/Cargo.lock

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

9 changes: 9 additions & 0 deletions qemu-cortex-r5-app/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[target.armv7r-none-eabihf]
rustflags = [
"-Clink-arg=-Tlinker.ld",
"-Ctarget-cpu=cortex-r5",
]
runner = "qemu-system-arm -machine versatileab -cpu cortex-r5f -semihosting -nographic -kernel"

[build]
target = ["armv7r-none-eabihf"]
1 change: 1 addition & 0 deletions qemu-cortex-r5-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
3 changes: 3 additions & 0 deletions qemu-cortex-r5-app/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"rust-analyzer.procMacro.enable": false
}
Loading

0 comments on commit 963a5ee

Please sign in to comment.