hello.rs 427 B

123456789101112131415161718192021
  1. //! Prints "Hello, world" on the OpenOCD console
  2. #![deny(unsafe_code)]
  3. #![deny(warnings)]
  4. #![no_main]
  5. #![no_std]
  6. extern crate cortex_m_rt as rt;
  7. extern crate cortex_m_semihosting as sh;
  8. extern crate panic_semihosting;
  9. extern crate stm32f1xx_hal;
  10. use core::fmt::Write;
  11. use rt::entry;
  12. #[entry]
  13. fn main() -> ! {
  14. let mut hstdout = sh::hio::hstdout().unwrap();
  15. writeln!(hstdout, "Hello, world!").unwrap();
  16. loop {}
  17. }