Hey,
Being new to Rust (not new to embedded) I started to go through the Rust Embedded Book
I'm using a STM32L476G Discovery Kit because I just happened to have one.
Hello world works OK, semihosting output indeed shows the "Hello, world!".
Next I build the "exception" example. The essential part is this:
#[entry]
fn main() -> ! {
let p = Peripherals::take().unwrap();
let mut syst = p.SYST;
// configures the system timer to trigger a SysTick exception every second
syst.set_clock_source(SystClkSource::Core);
syst.set_reload(8_000_000); // period = 1s
syst.enable_counter();
syst.enable_interrupt();
loop {}
}
#[exception]
fn SysTick() {
hprint!(".").unwrap();
}
What I'm trying to understand is that the dots come every two seconds. Not every second. As if the clock is 4MHz. All documentation that I could find describe that the clock is 8MHz. This puzzles me, and I wonder if I have something wrong in my configuration. How can I verify this?