diff options
| author | Roy Buitenhuis <[email protected]> | 2023-04-11 16:53:04 +0200 |
|---|---|---|
| committer | Roy Buitenhuis <[email protected]> | 2023-04-11 16:53:04 +0200 |
| commit | 00258bca4320bcf33f6285126a1f31fd6a9ed83c (patch) | |
| tree | 9209112db9eefb110c325f3ca9c421357eefc0c4 | |
| parent | 813bba200f1a068a47bc6d9eafc74a190ffb0316 (diff) | |
Add empty test binary for riscv
| -rwxr-xr-x | ci.sh | 2 | ||||
| -rw-r--r-- | tests/riscv32/.cargo/config.toml | 9 | ||||
| -rw-r--r-- | tests/riscv32/Cargo.toml | 46 | ||||
| -rw-r--r-- | tests/riscv32/memory.x | 14 | ||||
| -rw-r--r-- | tests/riscv32/src/bin/empty.rs | 16 |
5 files changed, 87 insertions, 0 deletions
| @@ -124,6 +124,8 @@ cargo batch \ | |||
| 124 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585ai --out-dir out/tests/iot-stm32u585ai \ | 124 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585ai --out-dir out/tests/iot-stm32u585ai \ |
| 125 | --- build --release --manifest-path tests/rp/Cargo.toml --target thumbv6m-none-eabi --out-dir out/tests/rpi-pico \ | 125 | --- build --release --manifest-path tests/rp/Cargo.toml --target thumbv6m-none-eabi --out-dir out/tests/rpi-pico \ |
| 126 | --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv7em-none-eabi --out-dir out/tests/nrf52840-dk \ | 126 | --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv7em-none-eabi --out-dir out/tests/nrf52840-dk \ |
| 127 | --- build --release --manifest-path tests/riscv32/Cargo.toml --target riscv32imac-unknown-none-elf \ | ||
| 128 | |||
| 127 | $BUILD_EXTRA | 129 | $BUILD_EXTRA |
| 128 | 130 | ||
| 129 | 131 | ||
diff --git a/tests/riscv32/.cargo/config.toml b/tests/riscv32/.cargo/config.toml new file mode 100644 index 000000000..1ffb0305d --- /dev/null +++ b/tests/riscv32/.cargo/config.toml | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | [target.riscv32imac-unknown-none-elf] | ||
| 2 | runner = "true" | ||
| 3 | rustflags = [ | ||
| 4 | "-C", "link-arg=-Tmemory.x", | ||
| 5 | "-C", "link-arg=-Tlink.x", | ||
| 6 | ] | ||
| 7 | |||
| 8 | [build] | ||
| 9 | target = "riscv32imac-unknown-none-elf" | ||
diff --git a/tests/riscv32/Cargo.toml b/tests/riscv32/Cargo.toml new file mode 100644 index 000000000..885776ae6 --- /dev/null +++ b/tests/riscv32/Cargo.toml | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | [package] | ||
| 2 | edition = "2021" | ||
| 3 | name = "embassy-riscv-tests" | ||
| 4 | version = "0.1.0" | ||
| 5 | license = "MIT OR Apache-2.0" | ||
| 6 | |||
| 7 | [dependencies] | ||
| 8 | critical-section = { version = "1.1.1", features = ["restore-state-bool"] } | ||
| 9 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync" } | ||
| 10 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["arch-riscv32", "nightly", "executor-thread"] } | ||
| 11 | embassy-time = { version = "0.1.0", path = "../../embassy-time" } | ||
| 12 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | ||
| 13 | |||
| 14 | riscv-rt = "0.11" | ||
| 15 | riscv = { version = "0.10", features = ["critical-section-single-hart"] } | ||
| 16 | |||
| 17 | |||
| 18 | [profile.dev] | ||
| 19 | debug = 2 | ||
| 20 | debug-assertions = true | ||
| 21 | opt-level = 's' | ||
| 22 | overflow-checks = true | ||
| 23 | |||
| 24 | [profile.release] | ||
| 25 | codegen-units = 1 | ||
| 26 | debug = 2 | ||
| 27 | debug-assertions = false | ||
| 28 | incremental = false | ||
| 29 | lto = "fat" | ||
| 30 | opt-level = 's' | ||
| 31 | overflow-checks = false | ||
| 32 | |||
| 33 | # do not optimize proc-macro crates = faster builds from scratch | ||
| 34 | [profile.dev.build-override] | ||
| 35 | codegen-units = 8 | ||
| 36 | debug = false | ||
| 37 | debug-assertions = false | ||
| 38 | opt-level = 0 | ||
| 39 | overflow-checks = false | ||
| 40 | |||
| 41 | [profile.release.build-override] | ||
| 42 | codegen-units = 8 | ||
| 43 | debug = false | ||
| 44 | debug-assertions = false | ||
| 45 | opt-level = 0 | ||
| 46 | overflow-checks = false | ||
diff --git a/tests/riscv32/memory.x b/tests/riscv32/memory.x new file mode 100644 index 000000000..316d577d4 --- /dev/null +++ b/tests/riscv32/memory.x | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | MEMORY | ||
| 2 | { | ||
| 3 | ROM : ORIGIN = 0x80000000, LENGTH = 0x00020000 | ||
| 4 | RAM : ORIGIN = 0x84000000, LENGTH = 0x00008000 | ||
| 5 | } | ||
| 6 | |||
| 7 | REGION_ALIAS("REGION_TEXT", ROM); | ||
| 8 | REGION_ALIAS("REGION_RODATA", ROM); | ||
| 9 | REGION_ALIAS("REGION_DATA", RAM); | ||
| 10 | REGION_ALIAS("REGION_BSS", RAM); | ||
| 11 | REGION_ALIAS("REGION_HEAP", RAM); | ||
| 12 | REGION_ALIAS("REGION_STACK", RAM); | ||
| 13 | |||
| 14 | _stack_start = ORIGIN(RAM) + LENGTH(RAM) - 4; | ||
diff --git a/tests/riscv32/src/bin/empty.rs b/tests/riscv32/src/bin/empty.rs new file mode 100644 index 000000000..d5a55c84f --- /dev/null +++ b/tests/riscv32/src/bin/empty.rs | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | |||
| 5 | use embassy_executor::Spawner; | ||
| 6 | |||
| 7 | #[panic_handler] | ||
| 8 | fn panic (_info: &core::panic::PanicInfo) -> ! { | ||
| 9 | loop {} | ||
| 10 | } | ||
| 11 | |||
| 12 | #[embassy_executor::main] | ||
| 13 | async fn main(_spawner: Spawner) { | ||
| 14 | // Don't do anything, just make sure it compiles. | ||
| 15 | loop {} | ||
| 16 | } | ||
