Programming The Arduino Due in Rust

13
Rust on Arduino Due Tim Kellogg @kellogh

description

Slides from my talk at GlueCon '14 about programming an Arduino Due in Rust, and about using Rust for embedded or IoT applications.

Transcript of Programming The Arduino Due in Rust

Page 1: Programming The Arduino Due in Rust

Rust on Arduino Due

Tim Kellogg@kellogh

Page 2: Programming The Arduino Due in Rust

Source: https://github.com/tkellogg/dueboot

Getting started on OSX:• http://arduino.cc/en/Guide/ArduinoDue• brew install rust• brew install llvm --all-targets• edit Rakefile of dueboot repository

Page 3: Programming The Arduino Due in Rust
Page 4: Programming The Arduino Due in Rust

• As fast as C/C++• No manual memory management, no GC• Functional goodies• Built-in unit testing• Polymorphism (but no inheritance)• Compiles to ARM (Android, Raspberry Pi, Due)

Page 5: Programming The Arduino Due in Rust
Page 6: Programming The Arduino Due in Rust

CPU Power?

Battery Life?

Quality?

Page 7: Programming The Arduino Due in Rust

Ariane 5

https://www.youtube.com/watch?v=kYUrqdUyEpI

Page 8: Programming The Arduino Due in Rust

"We've demonstrated how as little as a single bit flip can cause the driver to lose control of the engine speed in real cars due to software malfunction that is not reliably detected by any fail-safe"

Page 9: Programming The Arduino Due in Rust

• Buffer overflow• Unsafe casting• Race conditions between tasks

Page 10: Programming The Arduino Due in Rust
Page 11: Programming The Arduino Due in Rust

C binding generator:https://github.com/crabtw/rust-bindgen

Page 12: Programming The Arduino Due in Rust

Remaining Issues• Heap allocations• Interrupts as Tasks• Non-trivial language features

Page 13: Programming The Arduino Due in Rust

Book: Practical Internet of Things

@kellogh