# Are We Embedded Yet ## D7018E - Special Studies in Embedded Systems The course will be given as a self study course with a set of introductional seminars and accompanying mandatory assignments, followed by a larger assigmnent (project). The project can be carried out individually or in groups dependent on size. Grading will be individual, based on agreed requirements between the student and the teacher, showing understanding and abilities regarding: 1. The Rust ecosystem. Rustup (stable vs nightly), crates and toml files, cargo, rustc, llvm, gdb/lldb (and additional tooling rls, rustfmt, racer, xargo etc.) The Rust core and standard library. Building, bebugging/testing, documenting and publishing Rust applications and libraries. 2. Simple applications in Rust Prmitive types, tupels, structs, enums, etc. Flow control and functions. Macro usage. 3. Rust features Generics and polymorphism. Closures (and higher order functions). Iterators. Traits, definitions and implementations (derived and explicit). Marker traits. Type bounds. 4. The Rust Memory Model Theoretical underpinning, as well as impact to both memory safatey and code generation. Exterior (inherited) and interior mutability (Cell). Move vs. copy semantics, relation to Clone and Copy traits. Lifetimes and scoping. Static lifetimes, and the relation to the Sync trait. 6. Memory Safe Concurrency UnsafeCell, and synchronization in the RTFM model. Requirements for Stack Resource Policy (SRP) based single-core scheduling. 7. Macros Macro_rules/matching and expansion. Procedural macros (macros 2.0). Overview of the Rust RTFM implementation. 8. Building and debugginge embedded code in Rust Hardware abstractions using svd2rust (autogenerated from vendor provided SVD specifications). Compiling using xargo. Setting up openocd and gdb. 9. Pre-processing Custom build.rs build scripts, and the RTFM Concurrent Reactive Component model. ## Course Format Please fill out the [doodle](http://doodle.com) so we can arrange for a first scheduled seminar. We will use telegram [telegram](http://telegram.com) in order to confirm the preferred date. On the first seminar we will schedule 10 sessions for covering the above topics. Each topic will be accompanied by a set of small illustartive examples and assigments that each student should master (learning goals). On the following session, each student should prepare to discuss and demonstrate their solutions. Lectures and assigments will be covered over a 4 week period, leaving time for a larger assignment/project. Each project should be reported in terms of a git Rust crate, with sufficient documentation (readme.md) to build, and recreate the result. There will be two presentation rounds (at end of LP2 and LP3). Students taking (too many other) courses during LP2 may choose to present their project at end of LP3 (instead of LP2). Presentations will be oral, where the student(s), will present and demonstrate their work. Projects should be related to embedded programming, either on the target side (some application using the RTFM-core or CRC model), or on the host side, communicating with an embedded target running Rust RTFM. E.g., two groups can work together with building a system, e.g., with back-end processing of data collected by the embedded system, or proividing a front-end to the embedded system. Alternatively, host side project could relate the develpment of the RTFM-core/ RTFM-CRC frameworks or related tools (e.g. LLWM-KLEE as a backend for analysis of Rust code). ## Resources Students will carry out the assignemnts on their personal laptops (in case you don't have a working laptop we will try to lend you one). Tools used are available for linux and osx, but with a bit of trickery windows based installations should be possible (but you are on your own here). In case you don't run osx/linux native, virtual box or wmware is possible, though debugging of target MCUs are feasible it is a bit more tricky. Embedded targets STM32F401RE (nucleo) will be made available to all students. You will need to get an mini-usb cable yourselves. If you prefer to work with some other ARM Cortex M processor, let us know and we will have a look at available support. Teaching material will be made available through git (this project), build and refined throughout the course. We encourage all sorts of collaborations in between the students. Rust is not the easiest language to learn, and we will cover a lot of ground. Use the seminars to try to get as much as possible by beig well prepared in order to succeed. We will use telegram as the main means of communictation and support from teachers as well as other fellow students, (this way information will reach everyone, keeping support as efficient as possible). # Course in detail 1. [Contribution guidelines for this project](doc/Ecosystem.md) It's very easy to make some words **bold** and other words *italic* with Markdown. You can even [link to Google!](http://google.com)