Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Bump cortex-m dev-dep to 0.6 (it's only a dev-dep and so doesn't affe…
Browse files Browse the repository at this point in the history
…ct other packages)

Disable the semihosting test on thumbv8, as it's currently unsupported in cortex-m-semihosting
  • Loading branch information
thejpster committed Mar 16, 2019
1 parent d24d3e6 commit 5027cea
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
15 changes: 13 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,21 @@ autoexamples = true
r0 = "0.2.2"
cortex-m-rt-macros = { path = "macros", version = "0.1.5" }

[target.thumbv7em-none-eabihf.dev-dependencies]
cortex-m-semihosting = "0.3.1"

[target.thumbv7em-none-eabi.dev-dependencies]
cortex-m-semihosting = "0.3.1"

[target.thumbv7m-none-eabi.dev-dependencies]
cortex-m-semihosting = "0.3.1"

[target.thumbv6m-none-eabi.dev-dependencies]
cortex-m-semihosting = "0.3.1"

[dev-dependencies]
cortex-m = ">= 0.5.7, <0.7"
cortex-m = "0.6"
panic-halt = "0.2.0"
cortex-m-semihosting = "0.3.1"

[dev-dependencies.rand]
default-features = false
Expand Down
19 changes: 15 additions & 4 deletions examples/qemu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,39 @@
#![no_main]
#![no_std]

extern crate cortex_m;

extern crate cortex_m;
extern crate cortex_m_rt as rt;

#[cfg(not(armv8m))]
extern crate cortex_m_semihosting as semihosting;

extern crate panic_halt;

use core::fmt::Write;
use cortex_m::asm;
use rt::entry;

#[cfg(not(armv8m))]
#[entry]
fn main() -> ! {
use core::fmt::Write;
let x = 42;

loop {
asm::nop();

// write something through semihosting interface
let mut hstdout = semihosting::hio::hstdout().unwrap();
write!(hstdout, "x = {}\n", x);

write!(hstdout, "x = {}\n", x).unwrap();
// exit from qemu
semihosting::debug::exit(semihosting::debug::EXIT_SUCCESS);
}
}

#[cfg(armv8m)]
#[entry]
fn main() -> ! {
loop {
asm::nop();
}
}

0 comments on commit 5027cea

Please sign in to comment.