Introduction to Rust on the Stellaris Launchpad

What is Rust?

What is the Stellaris Launchpad?

It looks like this...

It has a bigger sibling too...

The Crates

Pure Rust Init


        #[link_section=".nvic_table"]
        #[no_mangle]
        pub static ISR_VECTORS: [Option<cortex_m::Handler>; 155] = [
          // Stack pointer
          Some(_stack_top),
          // Reset
          Some(reset_vector),
          // NMI
          Some(isr_nmi),
          ...
        ];
        

Pure Rust Init


          pub unsafe extern "C" fn reset_vector() {
              extern "C" {
                  static mut _bss_start: u32;
                  static mut _bss_end: u32;

                  static mut _data_start: u32;
                  static mut _data_end: u32;

                  static mut _heap_start: usize;
                  static mut _heap_end: usize;

                  static _data_start_flash: u32;
              }

              r0::zero_bss(&mut _bss_start, &mut _bss_end);
              r0::init_data(&mut _data_start, &mut _data_end, &_data_start_flash);

              alloc_cortex_m::init(&mut _heap_start, &mut _heap_end);

              board::init();
              main();
          }
        

Building the code

What works?

Where can I learn more?

My Github, github.com/thejpster

@japaric on Github, github.com/japaric

www.rust-lang.org

users.rust-lang.org

reddit.com/r/rust

An introductory video/slide show I did at work

My website and blog, thejpster.org.uk

/