Skip to content

Commit 6df9a38

Browse files
authored
Merge pull request #512 from newAM/probe-rs
probe-run -> probe-rs
2 parents f47ec95 + d401bb2 commit 6df9a38

File tree

8 files changed

+20
-61
lines changed

8 files changed

+20
-61
lines changed

.github/workflows/on-target.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Build testsuite
2222
env:
2323
RUSTFLAGS: -C link-arg=-Tlink.x -D warnings
24-
run: cargo build -p testsuite --target thumbv7m-none-eabi --features semihosting,cortex-m/critical-section-single-core
24+
run: cargo build -p testsuite --target thumbv7m-none-eabi
2525
- name: Install QEMU
2626
run: sudo apt-get update && sudo apt-get install qemu qemu-system-arm
2727
- name: Run testsuite
@@ -47,7 +47,7 @@ jobs:
4747
- name: Build testsuite
4848
env:
4949
RUSTFLAGS: -C link-arg=-Tlink.x -D warnings
50-
run: cargo build -p testsuite --target thumbv6m-none-eabi --features rtt,cortex-m/critical-section-single-core
50+
run: cargo build -p testsuite --target thumbv6m-none-eabi --features rtt
5151
- name: Upload testsuite binaries
5252
uses: actions/upload-artifact@v4
5353
with:
@@ -62,18 +62,18 @@ jobs:
6262
- hil-compile-rtt
6363
steps:
6464
- uses: actions/checkout@v4
65-
- name: Display probe-run version
66-
run: probe-run --version
65+
- name: Display probe-rs version
66+
run: probe-rs --version
6767
- name: List probes
68-
run: probe-run --list-probes
68+
run: probe-rs list
6969
- uses: actions/download-artifact@v4
7070
with:
7171
name: testsuite-bin
7272
path: testsuite-bin
7373
- name: Run on-target tests
7474
timeout-minutes: 5
7575
run: |
76-
probe-run \
76+
probe-rs run \
7777
--chip STM32F070RBTx \
7878
--connect-under-reset \
7979
testsuite-bin/testsuite

testsuite/Cargo.toml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,11 @@ version = "0.1.0"
77

88
[features]
99
rtt = ["rtt-target", "minitest/rtt"]
10-
semihosting = ["cortex-m-semihosting", "minitest/semihosting"]
1110

1211
[dependencies]
1312
cortex-m-rt.path = "../cortex-m-rt"
14-
cortex-m.path = "../cortex-m"
13+
cortex-m = { path = "../cortex-m", features = ["critical-section-single-core"] }
1514
minitest.path = "minitest"
1615
critical-section = "1.0.0"
17-
18-
[dependencies.rtt-target]
19-
version = "0.3.1"
20-
optional = true
21-
22-
[dependencies.cortex-m-semihosting]
23-
path = "../cortex-m-semihosting"
24-
optional = true
16+
cortex-m-semihosting.path = "../cortex-m-semihosting"
17+
rtt-target = { version = "0.5.0", optional = true }

testsuite/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Assuming you are at the root of the repository you can build like this:
1313

1414
```console
1515
$ cd testsuite
16-
$ cargo build --features semihosting
16+
$ cargo build
1717
Compiling testsuite v0.1.0 (cortex-m/testsuite)
1818
Finished dev [unoptimized + debuginfo] target(s) in 0.08
1919
```
@@ -27,7 +27,7 @@ For more information on QEMU reference the QEMU section in [The Embedded Rust Bo
2727

2828
```console
2929
$ cd testsuite
30-
$ cargo run --features semihosting
30+
$ cargo run
3131
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
3232
Running `qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel /cortex-m/target/thumbv7m-none-eabi/debug/testsuite`
3333
Timer with period zero, disabling
@@ -40,10 +40,10 @@ all tests passed!
4040

4141
No implementation-specific features are tested right now; any physical `thumbv7m` target should work.
4242

43-
Tests are executed with [probe-run](https://github.com/knurling-rs/probe-run).
43+
Tests are executed with [probe-rs](https://github.com/probe-rs/probe-rs).
4444

4545
* Update `memory.x` in the root of the repository to match your target memory layout.
46-
* Change the `probe-run` chip argument to match your chip, supported chips can be found with `probe-run --list-chips`
46+
* Change the `probe-rs` chip argument to match your chip, supported chips can be found with `probe-rs chip list`
4747
* Change the target to match your CPU
4848

4949
```console
@@ -53,7 +53,7 @@ $ cargo build --target thumbv7em-none-eabi --features rtt
5353
Compiling minitest v0.1.0 (/cortex-m/testsuite/minitest)
5454
Compiling testsuite v0.1.0 (/cortex-m/testsuite)
5555
Finished dev [unoptimized + debuginfo] target(s) in 0.16s
56-
$ probe-run --chip STM32WLE5JCIx --connect-under-reset ../target/thumbv7em-none-eabi/debug/testsuite
56+
$ probe-rs run --chip STM32WLE5JCIx --connect-under-reset ../target/thumbv7em-none-eabi/debug/testsuite
5757
(HOST) INFO flashing program (19 pages / 19.00 KiB)
5858
(HOST) INFO success!
5959
────────────────────────────────────────────────────────────────────────────────

testsuite/minitest/Cargo.toml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,11 @@ edition = "2018"
66
version = "0.1.0"
77

88
[features]
9-
semihosting = ["cortex-m-semihosting", "minitest-macros/semihosting"]
109
rtt = ["rtt-target", "minitest-macros/rtt"]
1110

1211
[dependencies]
13-
cortex-m.path = "../../cortex-m"
1412
cortex-m-rt.path = "../../cortex-m-rt"
13+
cortex-m-semihosting.path = "../../cortex-m-semihosting"
14+
cortex-m.path = "../../cortex-m"
1515
minitest-macros.path = "macros"
16-
17-
[dependencies.rtt-target]
18-
version = "0.3.1"
19-
optional = true
20-
21-
[dependencies.cortex-m-semihosting]
22-
path = "../../cortex-m-semihosting"
23-
optional = true
16+
rtt-target = { version = "0.5.0", optional = true }

testsuite/minitest/macros/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ version = "0.1.0"
99
proc-macro = true
1010

1111
[features]
12-
semihosting = []
1312
rtt = []
1413

1514
[dependencies]

testsuite/minitest/macros/src/lib.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -203,22 +203,7 @@ fn tests_impl(args: TokenStream, input: TokenStream) -> parse::Result<TokenStrea
203203

204204
#[cfg(feature = "rtt")]
205205
let init_logging = quote!({
206-
let channels = ::rtt_target::rtt_init! {
207-
up: {
208-
0: {
209-
size: 256
210-
mode: BlockIfFull
211-
name: "minitest"
212-
}
213-
}
214-
};
215-
unsafe {
216-
::rtt_target::set_print_channel_cs(
217-
channels.up.0,
218-
&((|arg, f| ::critical_section::with(|_| f(arg)))
219-
as ::rtt_target::CriticalSectionFunc),
220-
);
221-
}
206+
::rtt_target::rtt_init_print!();
222207
});
223208

224209
#[cfg(not(feature = "rtt"))]

testsuite/minitest/src/lib.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,22 @@ impl<T: Debug, E: Debug> TestOutcome for Result<T, E> {
3838
macro_rules! log {
3939
($s:literal $(, $x:expr)* $(,)?) => {
4040
{
41-
#[cfg(feature = "semihosting")]
41+
#[cfg(not(feature = "rtt"))]
4242
::cortex_m_semihosting::hprintln!($s $(, $x)*);
4343
#[cfg(feature = "rtt")]
4444
::rtt_target::rprintln!($s $(, $x)*);
45-
#[cfg(not(any(feature = "semihosting", feature="rtt")))]
46-
let _ = ($( & $x ),*);
4745
}
4846
};
4947
}
5048

5149
/// Stop all tests without failure.
5250
pub fn exit() -> ! {
53-
#[cfg(feature = "rtt")]
54-
cortex_m::asm::bkpt();
55-
#[cfg(feature = "semihosting")]
5651
cortex_m_semihosting::debug::exit(cortex_m_semihosting::debug::EXIT_SUCCESS);
57-
5852
unreachable!()
5953
}
6054

6155
/// Stop all tests and report a failure.
6256
pub fn fail() -> ! {
63-
#[cfg(feature = "rtt")]
64-
cortex_m::asm::udf();
65-
#[cfg(feature = "semihosting")]
6657
cortex_m_semihosting::debug::exit(cortex_m_semihosting::debug::EXIT_FAILURE);
67-
68-
#[cfg(not(feature = "rtt"))]
6958
unreachable!()
7059
}

testsuite/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ mod tests {
2727
}
2828

2929
#[test]
30-
#[cfg(not(feature = "semihosting"))] // QEMU does not model the cycle counter
30+
#[cfg(feature = "rtt")] // QEMU does not model the cycle counter
3131
fn cycle_count(p: &mut cortex_m::Peripherals) {
3232
#[cfg(not(armv6m))]
3333
{

0 commit comments

Comments
 (0)