The traditional approach to embedded development would be to run an RTOS on a microcontroller and to write the application in C or C++. This gives huge benefits in terms of the resources required compared to a Linux-based system, but now developers are working down in the world of systems programming, where there is nothing between them and a critical memory-safety bug except a keen eye and perhaps some expensive, imperfect and/or tricky-to-use static analysis tools. That bug might just give hackers access to a product and to anything the product is connected to, both locally and remotely.
Of course, there are plenty of things other than memory safety bugs that might give hackers a route straight into a product, but it would be preferable for developers to concentrate on those, instead of worrying about memory leaks, buffer overflows or tracking down the root cause of a random, undefined behaviour.
But after Rust came into existence the programmers are getting memory safety with low-level control.
If you have considered using embedded rust, you may have run into questions such as “What is embedded?”, “What is a driver crate?” “Where does rtfm/rtic and cortex_m fit into the picture?” This webinar will give you answers to these questions and how you can start your embedded rust journey
2. About Knoldus
Knoldus is a technology consulting firm with focus on modernizing the digital systems
at the pace your business demands.
DevOps
Functional. Reactive. Cloud Native
3. 01 Introduction
02 What is Rust? Why Rust
for Embedded?
03 What is an Embedded
System
04 STM32F3-Discovery
Board & it’s crates
05 Demo
Our Agenda
4. Introduction
● Nowadays we all are surrounded by the small system
which is making our day to day life easy and better.
● We are going to talk about this small system known as
Embedded System and how Rust Programming is
taking it further.
● Software embedded inside the small computer and
this small computer perform multiple functions using
its components. This whole system is an Embedded
System.
● We will also work with hardware(microcontroller) with
a Demo at last.
LEARN NOW
5. c
Rust Embedded
System?
Rust is a programming language but
not like other languages like java
python etc.
The difference is rust is a system
programming language, not an
application whose syntax is much
similar to c++ but guarantees more
safety than this.
LEARN NOW
We are going to program our hardware
using Rust Programming Language as we
have multiple reasons for that -
1. Safety
2.Rust Community support.
3. Control over memory and performance.
Why Rust for
Embedded?
6. OUR MISSION
An Embedded System is a
microcontroller or microprocessor-based
computer system that is used to perform
certain specific operations or tasks.
It can also be called as a computer
hardware system which do have
software embedded in it.
What is an Embedded
System??
8. c
Where we use
Embedded
System?
● If you look around yourself
you are all around with
embedded systems.
● Modern cars.
● Mobile phones.
● Medical
● Gaming
● Sensors
10. www.website.com
What is an
Microcontroller?
Microcontroller
A Micro-controller is considered a
small computer or semi-computer
that is used to perform some
specific task of an embedded
system.
It is present on a single metal-oxide-semiconductor integrated
circuit chip as shown below.
So we are going to work on this particular
micro-controller. STM32F303VCT6 DISCOVERY
Board commonly known as F3.
11. 01 A microcontroller
02 A number of LED’s, including the eight
aligned in a “compass” formation
03 Two buttons
04 Two USB ports
05 Sensors(Accelerometer, Magnetometer,
Gyroscope)
Components on the Discovery Board
13. Crates to use for LED Demo
To work on the hardware we need to know about the crates we are going to use.
These are the crates we have to include in our Cargo.toml.
● cortex-m
● cortex-m-rt
● panic-hal
● stm32f30x-hal
16. Great
Product!
Lorem ipsum
Great
collection of
slides easy
to edit.
Great
collection of
slides
Great
Slides
Access the LEDs Pin’s
on Port E
● To “on” the LED we have to access the pin of that particular LED.
● There are multiple ports and we can find about the port contains board LEDs from Board’s Manual.
● Port- E for stm32f3-Discovery Board. Access port e using “gpio” peripheral.
● Blink LED by providing register for mode(push/pull) and for output type(input/output)
17. www.website.com
Make led on and off with delay
set_high() and set_low() to on and off an led.
Microcontroller
01
Delay to make LED blink.
02
Program neither end nor it return any value
03
18. OUR MISSION
● I mentioned that the STM32F3DISCOVERY actually has
two microcontrollers.
a. ST-LINK as programmer/debugger
b. This ST-LINK is connected to the target
microcontroller using a Serial Wire Debug (SWD)
interface.
● As for OpenOCD, it's software that provides some
services like a GDB server on top of USB devices
OpenOcd & GDB
Server
20. www.website.com
Business Perspective
● Rust has been building up momentum. More and more organisations are looking to make
use of it (including Microsoft). Several organisations in the embedded space are already
using Rust.
● Rust takes the good parts of C and C++, and programming practices that enable good
quality code and bakes it in from the outset.
● Rust also avoids bugs. Bugs like Memory Bugs and Concurrency Bugs. Which makes our
program more better.