//! Prints "Hello, world" on the OpenOCD console #![deny(unsafe_code)] #![deny(warnings)] #![no_main] #![no_std] extern crate panic_semihosting; //extern crate panic_itm; extern crate stm32f1xx_hal; use cortex_m_semihosting::hprintln; use cortex_m_rt::{entry, exception, ExceptionFrame}; #[entry] fn main() -> ! { hprintln!("Hello, world!").unwrap(); loop {} } #[exception] fn HardFault(ef: &ExceptionFrame) -> ! { panic!("{:#?}", ef); } #[exception] fn DefaultHandler(irqn: i16) { panic!("Unhandled exception (IRQn = {})", irqn); }