Skip to content

Commit

Permalink
Fix l4r5zi build
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneider-bensch committed Oct 31, 2024
1 parent f024b8f commit 324cc51
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
17 changes: 13 additions & 4 deletions libcrux-nucleo-l4r5zi/src/bin/mldsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#![no_std]

use cortex_m::peripheral::Peripherals;
use libcrux_nucleo_l4r5zi as _; // global logger + panicking-behavior + memory layout
use libcrux_nucleo_l4r5zi as board; // global logger + panicking-behavior + memory layout

extern crate alloc;

use core::ptr::addr_of_mut;
use embedded_alloc::LlffHeap as Heap;
Expand All @@ -23,8 +25,15 @@ fn main() -> ! {
peripherals.DCB.enable_trace();
peripherals.DWT.enable_cycle_counter();
}
// set up the test config
let test_config = TestConfig {
core_freq: board::COREFREQ,
only_names: alloc::vec![],
early_abort: false,
benchmark_runs: 5,
};

libcrux_testbench::mldsa::run_benchmarks(test_config);

libcrux_testbench::mldsa::run_benchmarks();

libcrux_nucleo_l4r5zi::exit()
board::exit()
}
16 changes: 13 additions & 3 deletions libcrux-nucleo-l4r5zi/src/bin/mlkem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#![no_std]

use cortex_m::peripheral::Peripherals;
use libcrux_nucleo_l4r5zi as _; // global logger + panicking-behavior + memory layout
use libcrux_nucleo_l4r5zi as board; // global logger + panicking-behavior + memory layout

extern crate alloc;

use core::ptr::addr_of_mut;
use embedded_alloc::LlffHeap as Heap;
Expand All @@ -24,7 +26,15 @@ fn main() -> ! {
peripherals.DWT.enable_cycle_counter();
}

libcrux_testbench::mlkem::run_benchmarks();
// set up the test config
let test_config = TestConfig {
core_freq: board::COREFREQ,
only_names: alloc::vec![],
early_abort: false,
benchmark_runs: 5,
};

libcrux_testbench::mlkem::run_benchmarks(test_config);

libcrux_nucleo_l4r5zi::exit()
board::exit()
}
2 changes: 2 additions & 0 deletions libcrux-nucleo-l4r5zi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use embassy_stm32 as _; // memory layout

use panic_probe as _;

pub const COREFREQ: u32 = 4_000_000;

// same panicking *behavior* as `panic-probe` but doesn't print a panic message
// this prevents the panic message being printed *twice* when `defmt::panic` is invoked
#[defmt::panic_handler]
Expand Down

0 comments on commit 324cc51

Please sign in to comment.