Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/mps3-an536/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ semihosting = { version = "0.1.18", features = ["stdio"] }
arm-gic = { version = "0.7.1", optional = true }
critical-section = "1.2.0"
heapless = "0.9.1"
libm = "0.2.15"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be optional as with gic?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I was thinking about that feature. For the examples I'm inclined to make the GIC crate mandatory and remove the feature. If you don't want to use the GIC, don't use it. I don't know it makes the examples better if they show how to make your interrupt controller optional?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it was in the cortex-ar crate then yeah, totally should be optional.

Copy link
Contributor

@korken89 korken89 Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I mean examples are not really held by SemVer anyways. I think easy running of examples triumphs 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But lets take that in another PR, I can help out with that small thing. :)


[build-dependencies]
arm-targets = {version = "0.3.0", path = "../../arm-targets"}
Expand Down
202 changes: 202 additions & 0 deletions examples/mps3-an536/reference/fpu-test-armv8r-none-eabihf.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
Sine wave test (f32)...
( 0.0000) ..............................o
( 0.1253) .................................o
( 0.2487) .....................................o
( 0.3681) .........................................o
( 0.4818) ............................................o
( 0.5878) ...............................................o
( 0.6845) ..................................................o
( 0.7705) .....................................................o
( 0.8443) .......................................................o
( 0.9048) .........................................................o
( 0.9511) ..........................................................o
( 0.9823) ...........................................................o
( 0.9980) ...........................................................o
( 0.9980) ...........................................................o
( 0.9823) ...........................................................o
( 0.9511) ..........................................................o
( 0.9048) .........................................................o
( 0.8443) .......................................................o
( 0.7705) .....................................................o
( 0.6845) ..................................................o
( 0.5878) ...............................................o
( 0.4818) ............................................o
( 0.3681) .........................................o
( 0.2487) .....................................o
( 0.1253) .................................o
(-0.0000) .............................o
(-0.1253) ..........................o
(-0.2487) ......................o
(-0.3681) ..................o
(-0.4818) ...............o
(-0.5878) ............o
(-0.6845) .........o
(-0.7705) ......o
(-0.8443) ....o
(-0.9048) ..o
(-0.9511) .o
(-0.9823) o
(-0.9980) o
(-0.9980) o
(-0.9823) o
(-0.9511) .o
(-0.9048) ..o
(-0.8443) ....o
(-0.7705) ......o
(-0.6845) .........o
(-0.5878) ............o
(-0.4818) ...............o
(-0.3681) ..................o
(-0.2487) ......................o
(-0.1253) ..........................o
( 0.0000) ..............................o
( 0.1253) .................................o
( 0.2487) .....................................o
( 0.3681) .........................................o
( 0.4818) ............................................o
( 0.5878) ...............................................o
( 0.6845) ..................................................o
( 0.7705) .....................................................o
( 0.8443) .......................................................o
( 0.9048) .........................................................o
( 0.9511) ..........................................................o
( 0.9823) ...........................................................o
( 0.9980) ...........................................................o
( 0.9980) ...........................................................o
( 0.9823) ...........................................................o
( 0.9511) ..........................................................o
( 0.9048) .........................................................o
( 0.8443) .......................................................o
( 0.7705) .....................................................o
( 0.6845) ..................................................o
( 0.5878) ...............................................o
( 0.4818) ............................................o
( 0.3681) .........................................o
( 0.2487) .....................................o
( 0.1253) .................................o
(-0.0000) ..............................o
(-0.1253) ..........................o
(-0.2487) ......................o
(-0.3681) ..................o
(-0.4818) ...............o
(-0.5878) ............o
(-0.6845) .........o
(-0.7705) ......o
(-0.8443) ....o
(-0.9048) ..o
(-0.9511) .o
(-0.9823) o
(-0.9980) o
(-0.9980) o
(-0.9823) o
(-0.9511) .o
(-0.9048) ..o
(-0.8443) ....o
(-0.7705) ......o
(-0.6845) .........o
(-0.5878) ............o
(-0.4818) ...............o
(-0.3681) ..................o
(-0.2487) ......................o
(-0.1253) ..........................o
Sine wave test (f64)...
( 0.0000) ..............................o
( 0.1253) .................................o
( 0.2487) .....................................o
( 0.3681) .........................................o
( 0.4818) ............................................o
( 0.5878) ...............................................o
( 0.6845) ..................................................o
( 0.7705) .....................................................o
( 0.8443) .......................................................o
( 0.9048) .........................................................o
( 0.9511) ..........................................................o
( 0.9823) ...........................................................o
( 0.9980) ...........................................................o
( 0.9980) ...........................................................o
( 0.9823) ...........................................................o
( 0.9511) ..........................................................o
( 0.9048) .........................................................o
( 0.8443) .......................................................o
( 0.7705) .....................................................o
( 0.6845) ..................................................o
( 0.5878) ...............................................o
( 0.4818) ............................................o
( 0.3681) .........................................o
( 0.2487) .....................................o
( 0.1253) .................................o
(-0.0000) .............................o
(-0.1253) ..........................o
(-0.2487) ......................o
(-0.3681) ..................o
(-0.4818) ...............o
(-0.5878) ............o
(-0.6845) .........o
(-0.7705) ......o
(-0.8443) ....o
(-0.9048) ..o
(-0.9511) .o
(-0.9823) o
(-0.9980) o
(-0.9980) o
(-0.9823) o
(-0.9511) .o
(-0.9048) ..o
(-0.8443) ....o
(-0.7705) ......o
(-0.6845) .........o
(-0.5878) ............o
(-0.4818) ...............o
(-0.3681) ..................o
(-0.2487) ......................o
(-0.1253) ..........................o
( 0.0000) ..............................o
( 0.1253) .................................o
( 0.2487) .....................................o
( 0.3681) .........................................o
( 0.4818) ............................................o
( 0.5878) ...............................................o
( 0.6845) ..................................................o
( 0.7705) .....................................................o
( 0.8443) .......................................................o
( 0.9048) .........................................................o
( 0.9511) ..........................................................o
( 0.9823) ...........................................................o
( 0.9980) ...........................................................o
( 0.9980) ...........................................................o
( 0.9823) ...........................................................o
( 0.9511) ..........................................................o
( 0.9048) .........................................................o
( 0.8443) .......................................................o
( 0.7705) .....................................................o
( 0.6845) ..................................................o
( 0.5878) ...............................................o
( 0.4818) ............................................o
( 0.3681) .........................................o
( 0.2487) .....................................o
( 0.1253) .................................o
(-0.0000) .............................o
(-0.1253) ..........................o
(-0.2487) ......................o
(-0.3681) ..................o
(-0.4818) ...............o
(-0.5878) ............o
(-0.6845) .........o
(-0.7705) ......o
(-0.8443) ....o
(-0.9048) ..o
(-0.9511) .o
(-0.9823) o
(-0.9980) o
(-0.9980) o
(-0.9823) o
(-0.9511) .o
(-0.9048) ..o
(-0.8443) ....o
(-0.7705) ......o
(-0.6845) .........o
(-0.5878) ............o
(-0.4818) ...............o
(-0.3681) ..................o
(-0.2487) ......................o
(-0.1253) ..........................o
40 changes: 40 additions & 0 deletions examples/mps3-an536/src/bin/fpu-test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//! Simple FPU test

#![no_std]
#![no_main]

// pull in our start-up code
use cortex_r_rt::entry;

// pull in our library
use mps3_an536 as _;

use semihosting::println;

static BAR: &str = "............................................................";
const MAX_LEN: f32 = BAR.len() as f32;

/// The entry-point to the Rust application.
///
/// It is called by the start-up code in `cortex-r-rt`.
#[entry]
fn main() -> ! {
const STEPS: u32 = 100;
const RADIANS_PER_STEP: f32 = (2.0 * core::f32::consts::PI) / 50.0;
println!("Sine wave test (f32)...");
for row in 0u32..100u32 {
let angle = (row as f32) * RADIANS_PER_STEP;
let sine = libm::sinf(angle);
let bar_len = ((sine + 1.0) * (MAX_LEN / 2.0)) as usize;
println!("({:7.04}) {:.*}o", sine, bar_len, BAR);
}

println!("Sine wave test (f64)...");
for row in 0u32..100u32 {
let angle = (row as f64) * f64::from(RADIANS_PER_STEP);
let sine = libm::sin(angle);
let bar_len = ((sine + 1.0) * (f64::from(MAX_LEN) / 2.0)) as usize;
println!("({:7.04}) {:.*}o", sine, bar_len, BAR);
}
semihosting::process::exit(0);
}
1 change: 1 addition & 0 deletions examples/versatileab/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cortex-ar = { path = "../../cortex-ar", features = ["critical-section-single-cor
cortex-a-rt = { path = "../../cortex-a-rt" }
cortex-r-rt = { path = "../../cortex-r-rt" }
semihosting = { version = "0.1.18", features = ["stdio"] }
libm = "0.2.15"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be optional?


[build-dependencies]
arm-targets = { version = "0.3.0", path = "../../arm-targets" }
Expand Down
Loading