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; 155] = [
          // Stack pointer
          Some(_stack_top),
          // Reset
          Some(reset_vector),
          // NMI
          Some(isr_nmi),
          ...
        ];
        

Pure Rust Init


        pub unsafe extern "C" fn reset_vector() {
            let data_start_flash: *mut usize = &mut _data_start_flash;
            let data_start: *mut usize = &mut _data_start;
            let data_end: *mut usize = &mut _data_end;
            let bss_start: *mut usize = &mut _bss_start;
            let bss_end: *mut usize = &mut _bss_end;
            let heap_start: *mut usize = &mut _heap_start;
            let heap_end: *mut usize = &mut _heap_end;

            r0::init_data(data_start, data_end, data_start_flash);
            r0::zero_bss(bss_start, bss_end);

            alloc_cortex_m::init(heap_start, 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

/