I'm on section 5.4 of the Embedded Rust Discovery book. I've gotten the code to compile and load into the discovery board. When I get to 'break main', gdb breaks at line 7, #[entry]', not line 9, like the example in the book.
Typing continue works, but again it breaks at line 7 not 9. But when I type 'next', GDB hangs.
If I hit control-c, I get the following:
(gdb) next
^C
Program received signal SIGINT, Interrupt.
0x080039ac in HardFault_ (ef=0x10001d88) at /Users/jprain/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.6.12/src/lib.rs:555
555 atomic::compiler_fence(Ordering::SeqCst);
I'm using a Mac running 10.15.6.
The code I'm trying to use is the same as the book, but it's here:
#![deny(unsafe_code)]
#![no_main]
#![no_std]
use aux5::{entry, prelude::*, Delay, Leds};
#[entry]
fn main() -> ! {
let (mut delay, mut leds): (Delay, Leds) = aux5::init();
let half_period = 500_u16;
loop {
leds[0].on();
delay.delay_ms(half_period);
leds[0].off();
delay.delay_ms(half_period);
}
}
Thanks!